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 pair-program (revert-interval save-interval) | |
(interactive "nRevert Interval: \nnSave Interval: ") | |
(setq auto-revert-interval revert-interval) | |
(auto-revert-mode) | |
(run-at-time "1 sec" save-interval 'save-buffer)) |
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
def minimum (a,b,c): | |
val1 = a | |
if (b<a): | |
val1 = b | |
val2 = b | |
if (c<b): | |
val2 = c | |
if val1<val2: | |
return val1 | |
return val2 |
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
#!/usr/bin/env perl | |
use warnings; | |
@_history=(); | |
$_prompt1 = "perl> "; | |
$_prompt2 = "... "; | |
print "\nPERL interactive\n"; | |
_printlicense(); | |
print "\n\n$_prompt1"; |
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
#http://en.wikipedia.org/wiki/Bicycle_performance#Aerodynamics_vs_power | |
G = 9.8 #earth's gravitational constant | |
K1 = 0.0053 #lumped constant for all frictional losses (tires, bearings, chain), and is generally reported with a value of 0.0053 | |
K2 = 0.185 #lumped constant for aerodynamic drag and is generally reported with a value of 0.185 kg/m | |
def power(velocity_ground, velocity_air, grade, mass): | |
""" | |
mass is in kg | |
velocity_ground and velocity_air are in meters per second | |
grade is percent eg 0.05, 0.12 |
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
export MARKPATH=$HOME/.marks | |
function jump { | |
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" | |
} | |
function mark { | |
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1" | |
} | |
function unmark { | |
rm -i "$MARKPATH/$1" | |
} |
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
/** | |
* http://www.openjs.com/scripts/events/keyboard_shortcuts/ | |
* Version : 2.01.B | |
* By Binny V A | |
* License : BSD | |
*/ | |
shortcut = { | |
'all_shortcuts':{},//All the shortcuts are stored in this array | |
'add': function(shortcut_combination,callback,opt) { | |
//Provide a set of default options |
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 ($) { | |
$.fn.editable = function (func) { | |
// func returns true or false - if true the dom element is updated and the popup is removed | |
// func can have side effects | |
// depends on shortcut.js and your definition of the "editable-popup" and "bluelink" classes | |
this.css("cursor", "pointer"); | |
this.click(function (evt) { | |
// cleanup | |
$(".editable-popup").remove(); | |
shortcut.remove("Enter"); |
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
// depends on jQuery and handlebars | |
// http://jquery.com/ | |
// http://handlebarsjs.com/ | |
// less is always nice too | |
// http://lesscss.org/ | |
// as is jqueryui | |
// http://jqueryui.com/ |
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
def make_adder_function(x): | |
return lambda y:x+y | |
plus={} | |
add=[] | |
for i in range(20): | |
plus[i]=make_adder_function(i) | |
add.append(make_adder_function(i)) |
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
; unix | |
(setq scheme-program-name "csi -:c") | |
;(setq scheme-program-name "racket") | |
; winblows | |
; (setq scheme-program-name "C:/Progra~1/Racket/racket") | |
; winblows 7 | |
; (setq scheme-program-name "C:/Progra~2/Racket/racket") |