View gist:dc13e31b59c51110ddde
1 2 3 4 5 6 7 8 9 10
Require Import Program Omega.
 
Definition R (a b : nat * nat) :=
match a, b with
| (x1, y1), (x2, y2) => x1 < x2 \/ (x1 = x2 /\ y1 < y2)
end.
 
Program Fixpoint ack (m n : nat) {measure (m, n) (R)} : nat :=
match m with
| 0 => S n
View gist:0bd5e9bceff89c10048e
1
for %i in (../*.mp3) do @ffmpeg -i "../%i" -filter:a "atempo=1.33" -vn "%i"
View StringMap.js
1 2 3 4 5 6 7 8 9 10
// Copyright (C) 2011 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
View xmonad.hs
1 2 3 4 5 6 7 8 9
-- vim: expandtab shiftwidth=4 tabstop=4 :
-- Based on <https://gist.github.com/yeban/311016>
-- Some potential inspiration for the future:
-- <https://github.com/dmxt/Solarized-xmonad-xmobar/blob/master/xmonad.hs>
-- <https://www.haskell.org/haskellwiki/Xmonad/General_xmonad.hs_config_tips>
import XMonad
 
import qualified Data.Map as M
import qualified XMonad.StackSet as W
View fibonacci.hs
1 2 3 4
psi = (1 + sqrt 5) / 2
 
fib :: Integral a => a -> a
fib = round . (/ sqrt 5) . (psi ^)
View gist:8163399
1 2 3 4 5 6 7 8 9 10
(define-syntax is
(syntax-rules (a)
((_ x a y?)
(y? x))
((_ x a y? f a y?*)
(f (y? x)
(y?* x)))
((_ x a y? f x* a y?*)
(f (y? x)
(y?* x*)))))
View gist:7912279
1 2 3
import itertools
 
([1, 2, 5][i % 3] * 10**(i // 3) for i in itertools.count(0))
View gist:6262709
1 2 3 4 5 6 7
var node_list = document.getElementsByClassName('fancybox'),
nodes = [].slice.call(node_list);
 
var values = nodes.reduce(function(memo, current) {
var value = current.getAttribute('href');
return memo.concat(value);
}, []);
View post-receive
1 2 3 4 5 6 7 8 9 10
#!/bin/sh
# See also: GIT_DIR, GIT_WORK_TREE (core.worktree)
# @TODO: Back up before updating, possibly keep a few previous versions in a tarball
# See http://codex.wordpress.org/WordPress_Backups
# @TODO: Keep a list of updates, i.e. time, hash, perhaps commit message
# @TODO: Preserve modifications throughout deployments (untracked+ignored)
REPOSITORY_PATH=/www/srsniweb.git
git update-server-info
while read old_hash new_hash ref; do
View cycle.coffee
1 2 3 4 5 6 7 8
cycle = (values) ->
length = values.length
current = 0
-> values[current++ % length]
 
# Usage
c = cycle [1..3]
console.log c() for [1..5] # => 1 2 3 1 2
Something went wrong with that request. Please try again.