Skip to content

Instantly share code, notes, and snippets.

@znake
znake / rakefile.rb
Created April 1, 2012 09:31
Watch Rakefile for HAML
# Save this file as rakefile.rb in your folder
# within your .haml files.
# Start watching with
# $ rake
include Rake::DSL
require 'rake/clean'
task :default => [:watch]
@znake
znake / gist:2762039
Created May 21, 2012 12:06
PhoneGap minimal index
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta charset="utf-8">
<script type="text/javascript" charset="utf-8" src="cordova-1.6.0.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js"></script>
@znake
znake / gist:2762071
Created May 21, 2012 12:15
PhoneGap minimal app.coffee
window.onBodyLoad = ->
document.addEventListener "deviceready", onDeviceReady, false
onDeviceReady = ->
navigator.notification.alert "Hello CoffeeScript"
@znake
znake / gist:2762550
Created May 21, 2012 14:18
posterous css
<style type="text/css">
* {padding:0;margin:0;}
img {border:0;}
.posterousGalleryMainDiv {text-align:center;}
.clear {clear:both;font-size:5px;}
.left {float:left;}
.right {float:right;}
...
..
.
@znake
znake / gist:2762707
Created May 21, 2012 14:43
some VIMRC tricks
" disable VIM welcome screen
set shortmess+=I
" Softwrap for VIM
set wrap linebreak textwidth=0
set showbreak=>
" For usual moving behaviour in wrapped lines
map j gj
map k gk
@znake
znake / gist:2949342
Created June 18, 2012 16:44
Connect to your favorite VPN on Startup
tell application "System Events"
   tell current location of network preferences
       set VPNservice to service "Name of my favorite VPN" -- name of the VPN service
       if exists VPNservice then connect VPNservice
   end tell
end tell
@znake
znake / gist:3089157
Created July 11, 2012 09:00
clear fontcache OSX
$ atsutil databases -removeUser
# If you want to remove the font cache for all users, use this command, and provide your admin password when asked:
$ sudo atsutil databases -remove
# Once you’ve cleared the caches, you should stop and restart the ATS server with these commands:
$ atsutil server -shutdown
$ atsutil server -ping
@znake
znake / gist:3475724
Created August 26, 2012 07:32
Run Ruby in VIM
map <Leader>rr :set makeprg=ruby\ %<cr>:make<cr>
@znake
znake / gist:3475759
Created August 26, 2012 07:39
Run Ruby in VIM commands
:set makeprg=ruby\ %
:make
@znake
znake / gist:3475926
Created August 26, 2012 07:55
Run Python in Vim
map <Leader>rp :set makeprg=python\ %<cr>:make<cr>