Skip to content

Instantly share code, notes, and snippets.

View lilydjwg's full-sized avatar
🙃
dissappointed about the new UI and round avatars

依云 lilydjwg

🙃
dissappointed about the new UI and round avatars
View GitHub Profile
@cooldaemon
cooldaemon / GetSnippetsList.diff
Created August 10, 2009 08:45 — forked from thinca/GetSnippetsList.diff
neocomplcache + snipMate
*** snipMate.vim.old 2009-04-23 02:30:12.703125000 +0900
--- snipMate.vim 2009-04-23 01:41:56.890625000 +0900
***************
*** 187,190 ****
--- 187,202 ----
let num = inputlist(snippet) - 1
return num == -1 ? '' : s:multi_snips[a:scope][a:trigger][num][1]
endf
+
+ fun GetSnippetsList(ft)
--langdef=html
--langmap=html:.htm.html
--regex-html=/<h1[^>]*>(.*)<\/h1>/\1/h,header/
--regex-html=/<h2[^>]*>(.*)<\/h2>/. \1/h,header/
--regex-html=/<h3[^>]*>(.*)<\/h3>/. \1/h,header/
--regex-html=/<h4[^>]*>(.*)<\/h4>/. \1/h,header/
--regex-html=/<h5[^>]*>(.*)<\/h5>/. \1/h,header/
--regex-html=/<h6[^>]*>(.*)<\/h6>/. \1/h,header/
--regex-html=/<([a-zA-Z][a-zA-Z0-9]*)[^>]*[ \t]+id[ \t]*=[ \t]*'([^']+)'/\1#\2/o,object/
--regex-html=/<([a-zA-Z][a-zA-Z0-9]*)[^>]*[ \t]+id[ \t]*=[ \t]*"([^"]+)"/\1#\2/o,object/
@williscool
williscool / testapp.js
Created April 6, 2011 17:38
Testing out a vhost setup
// Expose modules in ./support for demo purposes
/**
* Module dependencies.
*/
var express = require('express');
// Edit /etc/vhosts
#!/usr/bin/env python
"""
Plot histogram from list of dates
Usage
=====
Feed newline separated unix time via STDIN.
Ex.1: plot repository activity::
@vayn
vayn / googleImageSearch.js
Created June 27, 2011 23:14
FireGestures script for google image search
/**
* Author:
* Vayn a.k.a. VT <[email protected]>
* http://vayn.is-programmer.com
*
* URL:
* http://p.vim-cn.com/cbG/js
*
* File: googleImageSearch.js
* Create Date: 2011年 06月 27日 星期一 09:29:57 CST
anonymous
anonymous / adhoc
Created July 31, 2011 17:38
Linux Ad-hoc shell script
#!/bin/bash
#####################################
#Author: Leon Lee #
#email: [email protected] #
#QQ: 730395591 #
#Version: 1.0 #
#Note: If you have some good ideas #
# or advice, please mail me^^ #
#####################################
@vayn
vayn / coffeebook.js
Created November 11, 2011 12:50
Bookmarklet for Little Book on CoffeeScript
# http://arcturo.github.com/library/coffeescript
javascript:(function(){var%20c=document.getElementById('container');c.style.width='720px';c.style.margin='0%20auto';})()
@gregburek
gregburek / rateLimitDecorator.py
Created December 7, 2011 01:51
Rate limiting function calls with Python Decorators
import time
def RateLimited(maxPerSecond):
minInterval = 1.0 / float(maxPerSecond)
def decorate(func):
lastTimeCalled = [0.0]
def rateLimitedFunction(*args,**kargs):
elapsed = time.clock() - lastTimeCalled[0]
leftToWait = minInterval - elapsed
if leftToWait>0:
@vgoklani
vgoklani / mongodb_drop.py
Created January 3, 2012 18:40
drop a database or collection via pymongo
# dropping a database via pymongo
from pymongo import Connection
c = Connection()
c.drop_database('mydatabase')
# drop a collection via pymongo
from pymongo import Connection
c = Connection()
c['mydatabase'].drop_collection('mycollection')
@vjt
vjt / conf.apache
Created February 22, 2012 15:32
GRC (Generic Colouriser/Colorizer) configuration for Apache / nginx access logs
# Configuration suitable to display Apache/nginx access logs
# Based on conf.proftpd by Pavol Domin
# Crafted by Marcello Barnaba <[email protected]>
# Get GRC at http://kassiopeia.juls.savba.sk/~garabik/software/grc.html
#
# ip number
regexp=^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
colours=bold magenta