Diberdayakan oleh Blogger.
Tampilkan postingan dengan label sites. Tampilkan semua postingan
Tampilkan postingan dengan label sites. Tampilkan semua postingan

Minggu, 13 April 2014

Building Static Sites with Kit and LESS – Part I

In this post we are going to walk you through a project. In the project, we will create a static HTML website, and we will be using Kit Language for constructing the HTML pages, and LESS CSS as the styling language.

If you followed our previous article on “Kit” introduction, you will find that it allows us to use variables and import external files, making it easy to manage a project with a large number of HTML pages.

Since “Kit” is a Codekit proprietary language and is also the only application that supports it at the moment (of this writing), you have to first install Codekit. It is available for $28. You can give the application a try via the trial version, which generously includes all features and capabilities.

Getting Started

Let’s create a new folder for our project and name it, for instance, “mysite”. In the folder, we create three folders named “kit”, “less”, “assets”.

The “kit” folder will contain the .kit files. In it, create a new folder named “inc” to save partial .kit files that will later be included into other files.

Similarly, we will create an “inc” folder under the “less” folder.

Lastly, the “assets” folder will contain the project’s CSS, JavaScript, and Images. Let’s create 3 more folders in it: “css”, “js”, and “img”. At the end, the project directory structure should look like this:

.├── assets│ ├── css│ ├── img│ └── js├── kit│ └── inc└── less └── inc

Launch Codekit. Drag and drop the project folder on to the application window to add it as a “Codekit Project”.

Creating the Files

One of the advantages of using Kit – as well as other similar languages like Haml or Jade – is that we can slice the documents into several partial files.

We can save the document’s header in “header.kit”, or use “footer.kit” for the document’s footer. When we make a change in “header.kit”, for an example, it will reflect on other pages where “header.kit” is included. This saves us a lot of time since the files need not be edited separately.

Kit Files

In this project, we create the following Kit files and saved them in “inc” folder:

  • “doc-open.kit” – contains stuff that open HTML documents that include the DOCTYPE, and the <head> tag.
  • “doc-close.kit” – contains the stuff to close the HTML document. We will put the </html> and </body> in it.
  • “header.kit”, “footer.kit”, “sidebar.kit”, “navigation.kit” – these files respectively contain the HTML structure for the document’s header, footer, sidebar, and the menu navigation.

And we create these Kit files below directly under the “kit” folder:

  • “index.kit” – this will be the homepage of the website.
  • “page.kit” – this is the second page of the website.
.├── assets│ ├── css│ ├── img│ └── js├── kit│ ├── inc│ │ ├── doc-close.kit│ │ ├── doc-open.kit│ │ ├── footer.kit│ │ ├── header.kit│ │ ├── navigation.kit│ │ └── sidebar.kit│ ├── index.kit│ └── page.kit└── less └── inc

We limit the website in this project to only 2 pages, so the tutorial would not be overwhelming but you can have as many pages as you want in an actual project.

LESS Files

We also create the LESS files in a similar structure. In addition, we will also utilize a LESS mixin library name LESSHat. So that we will be able to write our LESS codes faster and in simpler form. The following screenshot shows all the project’s LESS files.

.├── assets│ ├── css│ ├── img│ └── js├── kit│ ├── inc│ │ ├── doc-close.kit│ │ ├── doc-open.kit│ │ ├── footer.kit│ │ ├── header.kit│ │ ├── navigation.kit│ │ └── sidebar.kit│ ├── index.kit│ └── page.kit└── less ├── inc │ ├── footer.less │ ├── header.less │ ├── lesshat.less │ ├── navigation.less │ └── sidebar.less └── style.less

They are also listed in Codekit.

Kit SyntaxHighligting

Kit Language is basically HTML with special features. The problem is that the .kit extension is unknown by most code editors. If we open it, the code editor could not present it with proper color syntax highlighting automatically.

If you are using SublimeText, you can follow the following trick to enable syntax highlighting for Kit Language:

First, install PackageResourceViewer in SublimeText. This plugin allows us to quickly open SublimeText core packages. Once it has been installed, launch Command Palette – Cmd + Shift + P – and search “Open Resource”, without the quote.

Then, navigate to HTML > HTML.tmLanguage. In it you will see a list of extensions wrapped withing <string> tag. Add the support for .kit extension by including <string>kit</string> between the list. Save the file, and restart SublimeText.

The .kit file extension would be identified as an HTML file, and should also be given proper syntax color highlighting as HTML.

Output Path

All the files that we have created are listed in Codekit. Codekit will watch all these files and compile them when the changes are in place. By default, the compiled files will be saved at the same directory level as the source file, whereas all our project’s assets such as the CSS should be saved in the “assets” folder.

So, we need to configure the output path. Let’s enable the project-level setting.

LESS CSS output path

In the Setting page, navigate to the “Less” tab at the left sidebar. Select “To this path:” option. Enter /assets/css/ as the output path, and set the “Relative to” option to “The project’s root folder”, as follow.

Scroll-down the application window a little, and click the Apply Output Paths button to confirm the above configuration.

Kit output path

Kit compiles into HTML. We will save all HTML documents directly under the project root directory. Navigate to “Kit” tab. It is similar to the “Less” configuration that we have accomplished above. We select “To this path:” option. Enter / as the output path, and set the “Relative to” option to “The project’s root folder”.

Click the Apply Output Paths button at last.

To Be Continued

This is the end of our tutorial, Part 1. To sum up, we have set the project files, structure, and configuration. Next, we will start developing the website with Kit and LESS. So, stay tuned.



View the Original article

10 Best Sites To Help You Track Bitcoin Exchange Rates

Bitcoin may have become relatively more stable as of late, even after numerous security scares, but it’s still far from being completely stable. Bitcoin and other cryptocurrencies, unlike fiat currencies like the US Dollar, isn’t backed by governments and aren’t influenced by monetary policy. This makes it a lot more like gold than any other currency, since its value rests entirely on how much people are willing to pay, and how much its users believe in it. This, as you can imagine, can lead to volatility and uncertainty.

Winkdex

Given this uncertainty and potential for volatility, it would be quite a smart move to keep an eye on the value of Bitcoin, especially if you’re trying to make a profit from an investment. Even if you’re not an investor, it’s still a good idea to be aware, just in case. Here’s a list of 10 sites that you can use to track the value of Bitcoin.

1. Bitcoin Charts

Bitcoin Charts is probably the most comprehensive Bitcoin price tracker available. Bitcoin Charts tracks the price of Bitcoin in relation to a large number of currencies, including USD, EUR, GBP, JPY and even Ripple. Bitcoin Charts has a few different chart types and can even show moving averages and technical indicators such as accumulation/distribution and rate of change.

Bitcoin Charts

The time range for the charts can be as short as 1 day and as long as 8 years, with an All Data option. As you might expect, there isn’t enough data for the 4- and 8-year time ranges. Bitcoin Charts also has charts showing Bitcoin exchange volume distribution.

2. BitcoinWisdom

BitcoinWisdom tracks the price of Bitcoin on a number of major exchanges such as Bitstamp, BTC-e and Coinbase. BitcoinWisdom also tracks the price of Bitcoin in relation to other cryptocurrencies on exchanges such as Cryptsy and Bter. BitcoinWisdom has a few settings you can tweak, including chart styles and depth ranges.

BitcoinWisdom

The tracker updates in real time, and you can choose the time interval for the main graph, ranging from one minute to one week. Bitcoin Wisdom also has Bitcoin and Litecoin difficulty charts and mining calculators.

3. CoinDesk

CoinDesk’s Bitcoin price tracker has both their own Bitcoin Price Index (BPI), which averages the prices from three leading Bitcoin exchanges: Bitfinex, Bitstamp and BTC-e. The graph can display either the BPI, or price data from any of the three exchanges. Historical data for Mt. Gox is also included.

CoinDesk

CoinDesk can display both Closing and Open, High, Low, Close (OHLC) price data. The time frame for the graph ranges from 1 hour to an All setting that goes back as far as possible. You can also set a custom time frame.

4. Bitcoinity

Bitcoinity tracks the price of Bitcoin across a number of different exchanges and currencies. Unlike most trackers, Bitcoinity has a preferences section where you can customize your experience. You can, amongst others, choose the default theme, the precision of the price, whether to show prices in BTC or mBTC and hide trades smaller than a certain amount.

Bitcoinity

Bitcoinity has an alternate light-colored theme if you don’t like the default color scheme. The time range for the price chart ranges from 10 minutes up to a historical 2 year view. The change graph ranges from 1 minute to 1 hour. It also lets you zoom in and out.

5. Coinbase

Coinbase isn’t a dedicated price tracker, but still has a Charts view that tracks Bitcoin’s price. Coinbase has charts that track Bitcoin price in USD as well as the number of Bitcoin transactions per day. Coinbase is one of the few trackers that also tracks transaction volume, which may be of interest to some.

Coinbase

Like most other trackers, you can select the time range of the graph, from 1 day up to an All option. You can also set a custom time range. Coinbase doesn’t explicitly state the source of their price data.

6. Winkdex

Winkdex pools data from seven different exchanges, including Bitfinex, Bitstamp and CampBX, to provide an average price for Bitcoin. Winkdex weighs exchange prices according to transaction volume on the exchanges, so that high-price but low-transaction outliers will not greatly affect the average price.

Winkdex

Winkdex has a remarkably clean interface and gives you a number of range options, from as short as one day up to a Max option that shows all available data. Winkdex is still in beta and might have some bugs that need to be ironed out.

7. Blockchain

Blockchain draws its data from Bitcoinity, but presents it in a slightly easier to use way. Unlike Bitcoinity, Blockchain only tracks three currencies: USD, EUR and GBP. Blockchain also shows the BTC-e chat room in a small window, so you can keep up to date with all the gossip and discussion going on there.

Blockchain

The time range for the price chart on Blockchain ranges from 10 minutes up to 6 months, while the change graph ranges from 1 minute to 1 hour. You can also zoom in and out of the change graph.

8. Bitcoin Ticker

Bitcoin Ticker tracks the value of Bitcoin in real time on six different exchanges. These exchanges include BitStamp, BTCChina, Bitfinex and Kraken. Bitcoin Tracker also has a news ticker that shows all the latest Bitcoin-related news, as well as a real-time readout of buy and sell orders on the respective exchanges.

Bitcoin Ticker

The graph has a time range from 10 minutes to All Time. Bitcoin Ticker also has a Combined view mode that shows real-time price graphs for Bitfinex, Huobi, BitStamp and BTC-e on the same screen.

9. BigTerminal

BigTerminal tracks a large number of markets, including cryptocurrencies Bitcoin and Litecoin. As far as Bitcoin is concerned, BigTerminal can track both average and exchange-specific prices, namely on BitStamp, BTC-e and Coinbase. You can compare charts and even change the currency BigTerminal displays in.

BigTerminal

BigTerminal’s graph defaults to a quarterly view, but you can go as short as 15 minutes and as far back as a historical view. BigTerminal includes social sharing options as well as chart and drawing tools. You can even save the charts in a few different formats.

10. Bitwat.ch

Bitwat.ch does things a bit differently. Instead of tracking the value of Bitcoin, Bitwat.ch is a site that sends you alerts via e-mail when the price of Bitcoin rises above or drops below a certain price of your choosing. Bitwat.ch gets its data from CoinDesk‘s Bitcoin price tracker.

Bitwat.ch

You can also register on Bitwat.ch if you want to keep track of all your alerts. Registering also lets you delete alerts, which can be useful if the price levels you set have been made out of date, or if you’re just tired of receiving alerts.



View the Original article

Jumat, 21 Maret 2014

Newsbeat app creates a radio show based on your favorite news sites

Newsbeat app

If you’re anything like me, daily commute downtime is an opportunity to catch up on the news. Aggregation apps are great when you’re sitting on the bus, but you can’t really flip through your news feed whilst walking down a busy street or driving to work. The radio is an alternative option, but it’s not often that a topic which really interests me crops up.

Newsbeat, a new app for iOS and Android, aims to combine the best of both worlds, by organising the news that you’d like to hear about into a short radio show. The app, released by Tribune Company, has access to over 7,000 different news sources, ranging from major news networks and papers to small-time blogs.  The app pulls together various sources based on your preferences, and narrates the stories using some clever text-to-speech software.

You can put together a collection of news sources based on a huge range of topics and sections, such as politics, business, and technology, and you can manually add your favourite publications that you follow closely. It’s from this list that the app generates its own radio program, which kicks off which the familiar weather and traffic reports obtained from your GPS location. New stories are then read aloud by two voice actors, who condense the articles down into a short 60 to 90 second reports. You can also skip stories which aren’t of interest to you, and the app will learn from your listening habits.

Newsbeat app options

In terms of the text-to-speech voice, it’s much better than some of the older voices, but it’s definitely noticeable that you’re being talked to be a machine. I found the male voice to be much more convincing than the female reporter, but the overall the flow between words is more than acceptable.

If the voices become too irritating, the original text is also displayed in the app, so you can read the article, in full, for yourself. There’s also a “Daily Digest” option, which will send you an email detailing news that matches your interests at the start of your day.

News is currently limited to US publications, and although the app does a good job of recognizing your location for traffic updates, you currently won’t be able to add publications from your own native country.

The app is available on the Google Play Store right now, for free.

Like this post? Share it!