This file contains 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
$(document).ready( function() { | |
$.ajax({ | |
type: "GET", | |
dataType: 'text', | |
async: false, | |
url: "templates.html" | |
}).done(function(response) { | |
$("body").append(response); | |
ich.grabTemplates(); | |
}); |
This file contains 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
$(document).ready( function() { | |
$('#display').click(function () { | |
var data = [ | |
{ | |
"name": "Paul McCartney", | |
"email": "[email protected]", | |
"salary": "400" | |
}, | |
{ | |
"name": "John Lennon", |
This file contains 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
#!/bin/bash | |
path="src/main/web" | |
> "$path"/templates.ich | |
for file in "$path"/templates/* | |
do | |
cat "$file" >> "$path"/templates.ich |
This file contains 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 TemplateLoader = { | |
path: 'templates/', // template files are stored in this directory | |
templates: ['file1', 'file2', 'file3'], // put all your template files here | |
fetchTemplate: function(path) { | |
$.ajax({ | |
type: 'GET', | |
dataType: 'text', | |
async: false, | |
url: path | |
}).done(function(response) { |
This file contains 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
# define entries | |
entries = [{'type': '+', 'value': 9},\ | |
{'type': '+', 'value': 12.3},\ | |
{'type': '-', 'value': 4},\ | |
{'type': '+', 'value': 0.89},\ | |
{'type': '-', 'value': 2.65},\ | |
{'type': '-', 'value': 14.3},\ | |
{'type': '+', 'value': 6.8},\ | |
{'type': 'unknown', 'value': 200}] |
This file contains 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 time | |
start = time.clock() | |
for x in range(1,10000): | |
y = x**3 | |
elapsed = time.clock() - start | |
print elapsed |
This file contains 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
// binding "this" object only (function arguments are ignored) | |
if (!Function.prototype.bind) { | |
Function.prototype.bind = function bind(thisObject) { | |
var fun = this; | |
return function() { | |
fun.apply(thisObject, arguments); | |
}; | |
}; | |
} |
This file contains 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
// binding both "this" object and optionally arguments | |
if (!Function.prototype.bind) { | |
Function.prototype.bind = function bind(thisObject) { | |
var fun = this, boundArgs = Array.prototype.slice.call(arguments, 1); | |
return function() { | |
var allArgs = boundArgs; | |
if (arguments.length) { | |
allArgs = allArgs.concat(Array.prototype.slice.call(arguments)); | |
} |
This file contains 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
#!/usr/bin/python | |
import sys, dbus | |
knotify = dbus.SessionBus().get_object("org.kde.knotify", "/Notify") | |
try: title, text = sys.argv[1:3] | |
except: print 'Usage: knotify.py title text'; sys.exit(1) | |
knotify.event("warning", "kde", [], title, text, [], [], 0, 0, dbus_interface="org.kde.KNotify") |
This file contains 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
if (!Function.prototype.curry) { | |
(function () { | |
var slice = Array.prototype.slice; | |
Function.prototype.curry = function () { | |
var target = this; | |
var args = slice.call(arguments); | |
return function () { | |
var allArgs = args; |
OlderNewer