Skip to content

Instantly share code, notes, and snippets.

@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: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: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: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: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 / 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]