Skip to content

Instantly share code, notes, and snippets.

@rcmachado
rcmachado / html5.vim
Created December 15, 2009 10:35
Vim syntax file for HTML 5
" Vim syntax file
" Language: HTML (version 5)
" Maintainer: Rodrigo Machado <[email protected]>
" URL: http://gist.github.com/256840
" Last Change: 2010 Aug 26
" License: Public domain
" (but let me know if you liked it :) )
"
" Note: This file just adds the new tags from HTML 5
" and don't replace default html.vim syntax file
// ==UserScript==
// @name emblur
// @desc Unfocuses <embed>/<object> on focus.
// @help Hold shift/ctrl to turn off temporarily.
// @include main
// @author satyr
// @license X
// ==/UserScript==
function emblur(e){
switch(e.type){
syntax include @javaScriptE4X syntax/xml.vim
syntax region javaScriptE4XEmbedded matchgroup=javaScriptBraces start='{' end='}' contains=TOP,javaScriptE4X contained
syntax cluster xmlStartTagHook add=javaScriptE4XEmbedded
syntax cluster xmlRegionHook add=javaScriptE4XEmbedded
syntax cluster xmlTagHook add=javaScriptE4XEmbedded
syn region javaScriptE4X
\ start=@<\z(>\|\w[^ /!?<>"']*\)@
@eagletmt
eagletmt / clang_complete.vim
Created October 30, 2010 15:52
neocomplcache plugin to complete in C/C++ using clang
" original: http://github.com/Rip-Rip/clang_complete
" File: clang_complete.vim
" Author: Xavier Deguillard <[email protected]>
" Modified by: eagletmt <[email protected]>
"
" Description: Use of clang to complete in C/C++.
"
" Configuration: Each project can have a .clang_complete at his root,
" containing the compiler options. This is useful if
" lingr.vim {{{
" from thinca's .vimrc {{{
" http://soralabo.net/s/vrcb/s/thinca
if !exists('g:lingr')
call rtputil#remove('\<lingr-vim\>')
endif
if 0
@ynkdir
ynkdir / nsexample.vim
Created March 13, 2011 05:28
nsexample.vim
" 基本アイデア: 名前空間を実行時の環境に合わせることでファイルの変更なし
" にコピーできるようにする。
let s:ns = expand('<sfile>:p:r:gs?[\\/]?#?:s?^.*#autoload#??:s?$?#?')
function {s:ns}func()
echo "func()"
endfunction
@hotchpotch
hotchpotch / cocproxy.nginx.conf
Created May 25, 2011 04:50
cocproxy for nginx
#!nginx -p . -c cocproxy.nginx.conf
error_log /dev/stderr debug;
daemon off;
events {
worker_connections 48;
}
http {
@bongole
bongole / tmux.rb
Created July 14, 2011 08:18
brew tmux-1.5 pbcopy fix patch
require 'formula'
class Tmux < Formula
url 'http://sourceforge.net/projects/tmux/files/tmux/tmux-1.5/tmux-1.5.tar.gz'
md5 '3d4b683572af34e83bc8b183a8285263'
homepage 'http://tmux.sourceforge.net'
depends_on 'libevent'
def patches
@shokai
shokai / mount_ramdisk
Created August 5, 2011 06:48
mount ramdisk on Mac OSX
#!/usr/bin/env ruby
mount = '/Volumes/ramdisk'
newfs = '/dev/disk1'
if !ARGV.empty? and ARGV.first =~ /^-+u$/i
system "umount #{mount} && hdiutil detach #{newfs}"
else
if File.exists? newfs
STDERR.puts "already mounted - #{mount}"
STDERR.puts "use \"#{$0.split('/').last} -u\""
let s:n = 1
let s:q = ''
function! s:fizzbuzz()
if !len(s:q)
if s:n % 3 == 0 && s:n % 5 == 0
let s:q = "fizzbuzz "
elseif s:n % 3 == 0
let s:q = "fizz "
elseif s:n % 5 == 0
let s:q = "buzz "