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
;;; all code in this function lifted from the clojure-mode function | |
;;; from clojure-mode.el | |
(defun clojure-font-lock-setup () | |
(interactive) | |
(set (make-local-variable 'lisp-indent-function) | |
'clojure-indent-function) | |
(set (make-local-variable 'lisp-doc-string-elt-property) | |
'clojure-doc-string-elt) | |
(set (make-local-variable 'font-lock-multiline) t) |
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
(require '[clojure.contrib.repl-utils :as repl]) | |
(clojure.core/use 'clojure.core) | |
(ns books) | |
(defstruct book :author :title :year :rank) | |
(defmacro makebook [& vs] | |
`(struct-map book ~@vs)) |
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
set nocompatible | |
source $VIMRUNTIME/vimrc_example.vim | |
source $VIMRUNTIME/mswin.vim | |
source $VIMRUNTIME/eric_custom.vim | |
behave mswin | |
set ff="unix" | |
set encoding=utf-8 | |
set nobinary |
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 cgi | |
print "Content-Type: text/html" | |
form = cgi.FieldStorage() | |
if 'g' not in form: | |
out = "" |
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
Option Explicit | |
Private Function n(strike As Double, s As Double, sd As Double, r As Double, days As Double) As Double | |
Dim ls, lx, sd2, t As Double | |
ls = Log(s) | |
lx = Log(strike) | |
t = days / 365 | |
sd2 = pow(sd, 2) | |
n = ls - lx + r * t + sd2 * t / 2 | |
End 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
#!/usr/bin/env python | |
def twodigits(st): | |
g = st[2:] | |
if (len(g) == 1): | |
g = '0' + g | |
return g.upper() | |
def n2h(n): | |
r = hex(n) |
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 JSON; | |
use strict; | |
no warnings; | |
use HTML::Entities; | |
my $command = @ARGV[0]; | |
my $home = $ENV{'HOME'}; | |
if (not (-e "$home/.hn")) { |
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
javascript:(function() {document.write('<script src="https://gist.github.com/1040276.js"> </script>') })() | |
// why not just do this? |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int binsearch1(int, int[], int); | |
int binsearch2(int, int[], int); | |
int main(int argc, char *argv[]) | |
{ | |
int size = atoi(argv[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
//&>/dev/null;x="${0%.*}";[ ! "$x" -ot "$0" ]||(rm -f "$x";cc -o "$x" "$0")&&"$x" $*;exit | |
#include <stdio.h> | |
int main() { | |
char c; | |
while ((c = getchar()) != EOF) | |
putchar(c); | |
return 0; | |
} |