View bubble-sort.c
#include <stdlib.h>
#include <stdio.h>
int main()
{
int m[]={2, 8, 6, 5, 1};
int i, j, temp;
for (i = 1; i < sizeof(m) / sizeof(int); i++) {
for (j = 0; j < i; j++) {
View bubble-sort.c
#include <stdlib.h>
#include <stdio.h>
int main()
{
int m[5]={2, 8, 6, 5, 1};
int i = 1, j, c;
while (i < 5) {
j = 0;
View spans.html
<!DOCTYPE html>
<div id="wrapper"></div>
<script>
var limit = 100;
var step = 256 / limit;
var wrapper = document.getElementById('wrapper');
for (var color = 0; color < 256; color += step) {
color = Math.round(color);
console.log(color);
var span = document.createElement('span');
View spans2.html
<!DOCTYPE html>
<div id="wrapper"></div>
<script>
var count = 30;
var start = 'ffcc00';
var end = '6699cc';
var sR = parseInt(start.slice(0, 2), 16);
var sG = parseInt(start.slice(2, 4), 16);
var sB = parseInt(start.slice(4, 6), 16);
var eR = parseInt(end.slice(0, 2), 16);
View .htaccess
<Files "humans.txt">
ForceType 'text/plain; charset=utf-8'
</Files>
View pre-commit
#!/bin/bash
cd ./$(git rev-parse --show-cdup)
result=$(mktemp /tmp/pre-commit.XXXXX)
STAGED=${STAGED:---staged}
changed_py=$(git diff --name-only --diff-filter=AM $STAGED | grep -E '\.py$')
changed_js=$(git diff --name-only --diff-filter=AM $STAGED | grep -E '\.js$')
[[ -z $changed ]] && exit 0
View signals.py
# coding:utf-8
from sys import modules
import gc
import inspect
import six
from django.core.management.base import BaseCommand
from django.dispatch.dispatcher import Signal, WeakMethod
View django.py
# coding: utf-8
# Fork of https://gist.github.com/1242760
from django.http import HttpResponse
from rpclib.server.wsgi import WsgiApplication
class DjangoApplication(WsgiApplication):
def __call__(self, request):
django_response = HttpResponse()
View tag_info.py
# coding: utf-8
'''Django command for getting info about template tags and filters within your project
It suports two output formats: human readable (with extra doc) and vim quickfix format
Usage: ./manage.py tag_info tag_or_filter_name
'''
import os
import sys
View vim.rb
# To use this recipe you have to:
# $ brew install python --framework
# $ mkdir ~/Frameworks
# $ ln -s "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework" ~/Frameworks
# $ brew install ./vim.rb
require 'formula'
require 'open-uri'
class Vim < Formula