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 <AppKit/CPView.j> | |
CPTextViewDidFocusNotification = @"CPTextViewDidFocusNotification"; | |
CPTextViewDidBlurNotification = @"CPTextViewDidBlurNotification"; | |
@implementation CPTextView : CPControl | |
{ | |
DOMElement _inputElement; | |
id _delegate; | |
CPScrollView _scrollView; |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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 flask import Flask, request, redirect, url_for, make_response, abort | |
from werkzeug import secure_filename | |
from pymongo import Connection | |
from pymongo.objectid import ObjectId | |
from gridfs import GridFS | |
from gridfs.errors import NoFile | |
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) | |
DB = Connection().gridfs_server_test | |
FS = GridFS(DB) |
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
(defun color-theme-mustang () | |
(interactive) | |
(color-theme-install | |
'(color-theme-mustang | |
((background-color . "#202020") | |
(background-mode . dark) | |
(cursor-color . "#bdbdbd") | |
(mouse-color . "sienna1") | |
(foreground-color . "#bdbdbd")) | |
(default ((t (:background "#202020")))) |
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
module Jekyll | |
# Sass plugin to convert .scss to .css | |
# | |
# Note: This is configured to use the new css like syntax available in sass. | |
require 'sass' | |
require 'compass' | |
class SassConverter < Converter | |
safe true | |
priority :low |
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
eventsource | |
go-eventsource | |
client/client |
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
(function(){ | |
var BackboneEvents = { | |
on: function(events, callback, context) { | |
var ev; | |
events = events.split(/\s+/); | |
var calls = this._callbacks || (this._callbacks = {}); | |
while (ev = events.shift()) { | |
var list = calls[ev] || (calls[ev] = {}); | |
var tail = list.tail || (list.tail = list.next = {}); | |
tail.callback = callback; |
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
{ | |
"status_code": "400", | |
"errors": { | |
"order.ice_cream.flavor": ["Flavor cannot be blank", "Flavor must be one of 'vanilla', 'chocolate', or 'strawberry'"], | |
"order.ice_cream.container": ["Container must be one of 'bowl', or 'cone'"] | |
} | |
} |
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
[ | |
{ | |
"name": "Acme Broadcasting", | |
"published": true, | |
"markets": [ | |
{ | |
"name": "Boston", | |
"published": false, | |
"stations": [ | |
{ "name": "WQXZ", "published": false }, |
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
function isLeapYear (n) { return (n % 400 === 0) || ((n % 4 === 0) && (n % 100 !== 0)); } | |
isLeapYear(1999); // => false | |
isLeapYear(2000); // => true | |
isLeapYear(2011); // => false | |
isLeapYear(2012); // => true |
OlderNewer