Skip to content

Instantly share code, notes, and snippets.

@cperl82
cperl82 / gist:1742684
Created February 5, 2012 04:22
Custom statusline for NERDTree with Powerline
diff --git a/autoload/Powerline/Matches.vim b/autoload/Powerline/Matches.vim
index 2244f57..98d9cde 100644
--- a/autoload/Powerline/Matches.vim
+++ b/autoload/Powerline/Matches.vim
@@ -2,6 +2,7 @@ let g:Powerline#Matches#matches = {
\ 'command_t' : Pl#Match#Add('bufname("%")', 'GoToFile'),
\ 'ft_help' : Pl#Match#Add('&ft' , 'help'),
\ 'ft_man' : Pl#Match#Add('&ft' , 'man'),
+ \ 'ft_nerdtree' : Pl#Match#Add('&ft' , 'nerdtree'),
\ 'ft_qf' : Pl#Match#Add('&ft' , 'qf'),
@baopham
baopham / .osx
Created April 4, 2012 17:45
Defaults commands for OSX
# GistID: 2304197
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable subpixel font rendering on non-Apple LCDs
defaults write NSGlobalDomain AppleFontSmoothing -int 2
# Enable the 2D Dock
defaults write com.apple.dock no-glass -bool true
@baopham
baopham / mobile-redirect.mkd
Created April 11, 2012 22:29
Mobile Redirect js Snippets

Redirect Mobile Devices

<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "mobile.html";
}
//-->
@baopham
baopham / modal.html
Created May 28, 2012 19:35
Popup form -JQuery UI
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.20/themes/base/jquery-ui.css" type="text/css" media="all" />
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" />
<style>
body { font-size: 62.5%; }
label, input { display:block; }
input.text { margin-bottom:12px; width:95%; padding: .4em; }
fieldset { padding:0; border:0; margin-top:25px; }
@I82Much
I82Much / Scramble Solver Output.txt
Created May 30, 2012 05:27
Scramble Solver Output
FoundWord(word='a', locations=[Location(row=2, col=0)])
FoundWord(word='al', locations=[Location(row=2, col=0), Location(row=1, col=1)])
FoundWord(word='alice', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=2, col=3), Location(row=3, col=2)])
FoundWord(word='alien', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=3, col=2), Location(row=3, col=3)])
FoundWord(word='alin', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=3, col=3)])
FoundWord(word='aline', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=3, col=3), Location(row=3, col=2)])
FoundWord(word='alit', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=2, col=1)])
FoundWord(word='alite', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=2, col=1), Location(row=3, col=2)])
F
@baopham
baopham / apache.md
Created June 5, 2012 17:14
Apache notes

To set up a new domain name

$ sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mynewsite
  • Change the line DocumentRoot /var/www/ to DocumentRoot /var/www/mynewsite

  • Create an alias in /etc/apache2/sites-enabled:

@baopham
baopham / prompt_bpm_setup
Created December 7, 2012 04:54
Prezto bpm theme
#
# Based on sorin theme
#
# Authors:
# Bao Pham <gbaopham@gmail.com>
#
# Screenshots:
# http://cl.ly/image/0O3y120B0T1z
# http://cl.ly/image/111H2O170z0Q
#
@baopham
baopham / .zshenv
Created March 19, 2013 08:39
zshenv for Prezto
#
# Defines environment variables.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# GistID: 5194548
#
# Browser
@baopham
baopham / git_commands.md
Created February 23, 2012 19:32
git commands notes

To delete a commit

Assuming you are sitting on that commit

git reset --hard HEAD~1

Or

@mattetti
mattetti / rack_example.ru
Created December 8, 2011 13:58
Very basic rack application showing how to use a router based on the uri and how to process requests based on the HTTP method used.
#########################################
# Very basic rack application showing how to use a router based on the uri
# and how to process requests based on the HTTP method used.
#
# Usage:
# $ rackup rack_example.ru
#
# $ curl -X POST -d 'title=retire&body=I should retire in a nice island' localhost:9292/ideas
# $ curl -X POST -d 'title=ask Satish for a gift&body=Find a way to get Satish to send me a gift' localhost:9292/ideas
# $ curl localhost:9292/ideas