Skip to content

Instantly share code, notes, and snippets.

View htom78's full-sized avatar

htom78

View GitHub Profile
www:
requirements:
- faye
- jade
@htom78
htom78 / .vimrc
Created April 20, 2012 06:59 — forked from cloud8421/.vimrc
Set up Vim on Mac or Linux. curl https://raw.github.com/gist/2426726/vim.sh | sh
" this is the configuration file for linux and mac systems
" symlink this to your home folder as .vimrc
" It loads pathogen and loads all modules from ~/.vim/bundles.
" It then loads ~/.vimrc_main which has the main
" configuration that works across all systems.
call pathogen#runtime_prepend_subdirectories(expand('~/.vim/bundles'))
call pathogen#helptags()
source ~/.vimrc_main
@htom78
htom78 / .vimrc
Created April 20, 2012 07:16 — forked from napcs/.vimrc
Set up Vim on Mac or Linux. final. curl https://raw.github.com/gist/2426799/vim.sh | sh
" this is the configuration file for linux and mac systems
" symlink this to your home folder as .vimrc
" It loads pathogen and loads all modules from ~/.vim/bundles.
" It then loads ~/.vimrc_main which has the main
" configuration that works across all systems.
call pathogen#runtime_prepend_subdirectories(expand('~/.vim/bundles'))
call pathogen#helptags()
source ~/.vimrc_main

Vim Cheatsheet

Generally helpful stuff

Open a file for editing             :e path/to/file.txt
Return to Normal mode               ESC   or <CTRL>+C

Navigating around text

// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@htom78
htom78 / gist:4265417
Created December 12, 2012 06:16 — forked from lucifr/gist:1208100
<?php
class PassAPI extends Plugin
{
# Registration
# register a device to receive push notifications for a pass
#
# POST /v1/devices/<deviceID>/registrations/<typeID>/<serial#>
# Header: Authorization: ApplePass <authenticationToken>
# JSON payload: { "pushToken" : <push token, which the server needs to send push notifications to this device> }
#
#!/usr/bin/env python
# coding:utf-8
import _env
from time import time
from urllib import urlencode
from urllib2 import urlopen as urlopen2
from urlparse import parse_qsl
from hashlib import md5
from urlgrabber import urlopen
import errno
bootstrap-tooltip.js
bootstrap-popover.js
bootstrap-alert.js
bootstrap-button.js
bootstrap-carousel.js
bootstrap-collapse.js
bootstrap-dropdown.js
bootstrap-modal.js
bootstrap-scrollspy.js
bootstrap-tab.js
;(function($){
$.support.touch = 'ontouchend' in document;
if (!$.support.touch) {
return;
}
var eventMap = {
click: 'touchend',
mousedown: 'touchstart',