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 toArray(enum) { | |
return Array.prototype.slice.call(enum); | |
} | |
Function.prototype.curry = function() { | |
if (arguments.length<1) { | |
return this; //nothing to curry with - return function | |
} | |
var __method = this; | |
var args = toArray(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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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 area = document.getElementById('area'); | |
var buffer = []; | |
var position = 0; | |
var last_id = 1; | |
var last_length = 0; | |
var socket = io.connect('http://localhost:5000'); |
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
Error.stackTraceLimit = Infinity; | |
// Called before getting the stack property | |
Error.prepareStackTrace = function(e,s){ | |
console.log(e,s); | |
}; | |
// "Error" object | |
var a = {toString:function() | |
{ |
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
<html> | |
<head> | |
<title>testing</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="compose.js"></script> | |
<div id="res"></div> | |
</body> | |
</html> |
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 apply_operation = function(content, op) { | |
var buffer = content.split(''); | |
var cursor = 0; | |
op.forEach(function (action) { | |
if (action.retain) { | |
cursor += action.retain; | |
// console.log('retain', '+'+action.retain, buffer.join(''), cursor); | |
} | |
else if (action.insert) { | |
var args = [cursor, 0]; |
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 ApplicationController = function (users) { | |
this.$scope.current_user = users.index('identity').one(); | |
}; | |
ApplicationController.prototype.logout = function () { | |
delete this.$scope.current_user; | |
}; | |
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
""" | |
WSGI config for csshat project. | |
This module contains the WSGI application used by Django's development server | |
and any production WSGI deployments. It should expose a module-level variable | |
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover | |
this application via the ``WSGI_APPLICATION`` setting. | |
Usually you will have the standard Django WSGI application here, but it also | |
might make sense to replace the whole Django WSGI application with a custom one |
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 | |
import sys | |
# Install venv by `virtualenv --distribute venv` | |
# Then install depedencies: `source venv/bin/active` | |
# `pip install -r requirements.txt` | |
activate_this = '/var/www/apache/csshat.com/csshat.com/venv/bin/activate_this.py' | |
execfile(activate_this, dict(__file__=activate_this)) | |
path = os.path.join(os.path.dirname(__file__), os.pardir) |
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
" highlight | |
syntax on | |
" use utf8 | |
set encoding=utf-8 nobomb | |
" identation plugin | |
filetype plugin indent on | |
" disable compat |