Skip to content

Instantly share code, notes, and snippets.

@defunkt
defunkt / installing-mustache.vim.md
Created March 6, 2010 10:21
Installing mustache.vim

mustache.vim

In your shell:

cd ~/.vim
git clone git://github.com/juvenn/mustache.vim.git
mv mustache.vim/syntax/* syntax/
mv mustache.vim/indent/* indent/
mv mustache.vim/ftdetect/* ftdetect/

rm -rf mustache.vim

@josevalim
josevalim / _yerb.rb
Created March 18, 2010 16:41
Who needs HAML when you have YAML + ERB?
# = YERB
#
# Who needs HAML when you have YAML + ERB? ;)
#
# See example.yaml below for an example. You can run this code
# by cloning this gist and then `ruby _yerb.rb example.yaml`.
#
# Notice that you need Ruby 1.9 so the hash order is preserved.
# Obviously, this is just for fun. Definitely slow as hell.
#
<html>
<head>
<title>We love shadows! A dynamic light source example created with JavaScript and CSS3</title>
<meta name="description" content="An example created by Sandro Paganotti trying to reproduce a light source effect using Javascript and CSS3" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Josefin+Sans+Std+Light' rel='stylesheet' type='text/css'>
<style>
body{
background: #575757;
@sindresorhus
sindresorhus / mysql-backup-windows.bat
Created March 14, 2011 14:50
Backup MySQL databases in separate gzipped sql files on Windows
@echo off
set dbUser=root
set dbPassword=password
set backupDir="C:\Documents and Settings\user\Desktop\backup\mysql"
set mysqldump="C:\Program Files\MySQL\MySQL Workbench 5.2 CE\mysqldump.exe"
set mysqlDataDir="C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data"
set zip="C:\Program Files\7-Zip\7z.exe"
:: get date
@fnhipster
fnhipster / html5.haml
Created April 9, 2011 01:19
HTML5 HAML Template
!!! 5
%html
%head
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
@pksunkara
pksunkara / config
Last active April 28, 2024 18:59
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@ymirpl
ymirpl / gist:1052094
Created June 28, 2011 20:21
Python unicode e-mail sending
#coding: utf-8
from cStringIO import StringIO
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
from email import Charset
from email.generator import Generator
import smtplib
# Example address data
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@fasthold
fasthold / Pdo_Mysql.php
Created July 17, 2011 09:49
简易封装PDO_MySQL
<?php
/**
* Pdo MySql driver wrap
*
* @category Class
* @package Fasthold Own PHP Snippet
* @copyright Copyright (c) 2007
* @license New BSD License
* @author Fasthold Lau (fasthold@gmail.com)
*/
@aisipos
aisipos / jsonp-in-flask.py
Created July 20, 2011 01:20 — forked from farazdagi/jsonp-in-flask.py
JSONP in Flask
import json
from functools import wraps
from flask import redirect, request, current_app
def support_jsonp(f):
"""Wraps JSONified output for JSONP"""
@wraps(f)
def decorated_function(*args, **kwargs):
callback = request.args.get('callback', False)
if callback: