Open terminal and type:
1. Create a directory at ~/bin:
mkdir ~/bin
2. Copy sublime executable to your ~/bin directory:
#!/usr/local/bin/node | |
var sys = require('sys'); | |
var http = require('http'); | |
var url = require('url'); | |
var PREFIX = '/db/'; | |
var TARGET = 'http://example.cloudant.com'; | |
var PORT = 8001; |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
Standard | |
Bleed Margin: 90mm x 52mm | |
Content Ends: 87mm x 49mm | |
Imperial | |
Bleed Margin: 3.54in x 2.05in | |
Content Ends: 3.43in x 1.93in | |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
require 'formula' | |
class LibdnetPython <Formula | |
depends_on 'libdnet' | |
url 'http://libdnet.googlecode.com/files/libdnet-1.12.tgz' | |
homepage 'http://code.google.com/p/libdnet/' | |
sha1 '71302be302e84fc19b559e811951b5d600d976f8' | |
def install | |
ENV["CFLAGS"] = "-O3 -w -pipe" |
<?php | |
// Define a 32-byte (64 character) hexadecimal encryption key | |
// Note: The same encryption key used to encrypt the data must be used to decrypt the data | |
define('ENCRYPTION_KEY', 'd0a7e7997b6d5fcd55f4b5c32611b87cd923e88837b63bf2941ef819dc8ca282'); | |
// Encrypt Function | |
function mc_encrypt($encrypt, $key){ | |
$encrypt = serialize($encrypt); | |
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM); | |
$key = pack('H*', $key); |
from urllib2 import urlopen | |
code = urlopen("http://example.com/").code | |
if (code / 100 >= 4): | |
print "Nothing there." | |
# via http://stackoverflow.com/questions/1966086/how-can-i-determine-if-anything-at-the-given-url-does-exist |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'gollum/app' | |
gollum_path = File.expand_path(File.join(File.dirname(__FILE__), 'database.git')) # CHANGE THIS TO POINT TO YOUR OWN WIKI REPO | |
Precious::App.set(:gollum_path, gollum_path) | |
Precious::App.set(:default_markup, :markdown) # set your favorite markup language | |
Precious::App.set(:wiki_options, {:live_preview => false, :universal_toc => false, :user_icons => 'gravatar'}) | |
module Precious | |
class App < Sinatra::Base | |
# Creates a simple authentication layer |