This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Idle-Fingers Colorscheme | |
~~~~~~~~~~~~~~~~~~~~~~~~ | |
Converted by Vim Colorscheme Converter | |
""" | |
from pygments.style import Style | |
from pygments.token import Token, Comment, Name, Keyword, Generic, Number, Operator, String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Git Chart - Number of lines changed per author | |
Auhthor: honza <http://github.com/honza> | |
Usage: Drop this file into a Git repo and run it! | |
""" | |
from commands import getoutput | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from commands import getoutput | |
class Blamer(object): | |
""" | |
This script will run through all the files git tracks, and see how many | |
lines each user has written/edited. You will get a number of lines and | |
percentage. Throughout the course of a project, you will add lines and your | |
lines will be deleted. This shows you how much of your code is still in the | |
project now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse, HttpResponseRedirect | |
from settings import CONSUMER_KEY, CONSUMER_SECRET, SCOPES, URL | |
import gdata.contacts.client | |
import gdata | |
def index(request): | |
client = gdata.contacts.client.ContactsClient(source='yo') | |
if 'token' not in request.session: | |
callback = "%s/callback" % URL | |
request_token = client.GetOAuthToken(SCOPES, callback, CONSUMER_KEY, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ -> | |
# Widget class example | |
class Widget | |
constructor: (@model, @events) -> | |
_keepThis: (func, obj) -> | |
args = Array.prototype.slice.call arguments, 2 | |
-> func.apply obj, args.concat arguments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var __hasProp = Object.prototype.hasOwnProperty; | |
var __extends = function(child, parent) { | |
// copy all properties from parent to child | |
for (var key in parent) { | |
if (__hasProp.call(parent, key)) | |
child[key] = parent[key]; | |
} | |
function ctor() { | |
this.constructor = child; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do -> | |
class Animal | |
constructor: -> | |
alert 'Hello' | |
class Nothing | |
constructor: -> | |
alert "Won't say anything" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var mustache = require('mustache'); | |
var BASE = fs.readFileSync('base.html', 'utf-8'); | |
var CACHE = {}; | |
var context = { | |
name: 'Honza', | |
age: 22 | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* How do you like your Javascript variables? | |
* Is there a PEP8 for Javascript? | |
*/ | |
// Option 1 | |
var viewPage = function() {}; | |
// Option 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When run multiple times, the following logs `false` 50% of the time and `true` 50% of the time | |
var geocoder = new google.maps.Geocoder(); | |
geocoder.geocode({'address': '211 Horseshoe Lake Drive, Halifax, Canada'}, function(results, status) { | |
console.log(status == google.maps.GeocoderStatus.OK); | |
}); |
OlderNewer