⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Box Shadow</title> | |
<style> | |
.box { | |
height: 150px; | |
width: 300px; | |
margin: 20px; |
#!/usr/bin/ruby | |
# README | |
# gem install aws-sdk | |
# add this to bashrc | |
# export HT_DEV_AWS_ACCESS_KEY_ID=???? | |
# export HT_DEV_AWS_SECRET_ACCESS_KEY=???? | |
# put your pem file in ~/.ssh and chmod 0400 | |
# for more info see; https://rubygems.org/gems/aws-sdk |
{ | |
// Sets the colors used within the text area. | |
// The value "auto" will switch between the "light_color_scheme" and | |
// "dark_color_scheme" based on the operating system appearance. | |
"color_scheme": "auto", | |
"light_color_scheme": "Breakers.sublime-color-scheme", | |
"dark_color_scheme": "Mariana.sublime-color-scheme", | |
// Note that the font_face and font_size are overridden in the platform | |
// specific settings file, for example, "Preferences (Linux).sublime-settings". |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
Someone asked how to get the latlong from a specific road near a town on OpenStreetMap.
If you need to do it only once (e.g., you're about to go on a trip, and your GPS cannot find your destination city, but allows you to enter GPS coordinates), you can use Nominatim, OpenStreetMap's geocoding interface.
If you need to do it multiple times, in a programmatic manner, there are at least two ways to do that.
Note: I worked with OSM data a couple of years ago, but I don't have an OSM database on my local laptop right now, so some instructions will be a bit fuzzy. I do apologize in advance.
# terminal customs | |
export BUNDLER_EDITOR=/usr/local/bin/subl | |
export CLICOLOR=1 | |
# history | |
export HISTCONTROL=erasedups | |
export HISTSIZE=100000 | |
# fixes Postgre failure | |
export PGHOST=localhost |
require 'spec_helper' | |
# Based on https://github.com/rails/ssl_requirement/blob/master/lib/ssl_requirement.rb | |
class SslRequirement | |
def initialize(app, options= {}) | |
@app = app | |
@allowed = options[:allowed] | |
@required = options[:required] | |
end | |
Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.
Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.
As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.
Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.