Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
set -e
# This is a nasty kluge, but it seems to work. Better check the output when
# upgrading to a new release of the nvidia driver, though.
if [ "$#" -ne 4 ]; then
printf 'USAGE: %s modulename packagename README.txt nv-kernel.o\n' "$0"
exit 1
fi
@ion1
ion1 / test-fsck-ioprio
Created August 3, 2010 01:33
test-fsck-ioprio
#!/bin/sh
set -e
if [ "$#" -ne 2 ]; then
>&2 printf 'USAGE: %s device0 device1\n' "$0"
exit 1
fi
device0="$1"; shift
device1="$1"; shift
@ion1
ion1 / README
Created August 26, 2010 20:35
password.rb
http://github.com/ion1/mischacks
http://rubygems.org/gems/mischacks
@ion1
ion1 / brightness.conf
Created December 6, 2010 17:05
/etc/init/local/brightness.conf
start on filesystem
task
exec /usr/bin/setpci -s 00:02.0 f4.b=ff
@ion1
ion1 / FclabelsExample.hs
Created January 27, 2011 07:46
fclabels example
{-# LANGUAGE TemplateHaskell #-}
import Data.Record.Label
data Foo = Foo { _foo :: Integer, _bar :: Integer, _baz :: Integer }
deriving Show
$(mkLabels [''Foo])
main = print $ modL bar (42+) (Foo 1 2 3)
@ion1
ion1 / moved.md
Created May 20, 2011 01:11
Linewise charset conversion
@ion1
ion1 / Break.hs
Created July 15, 2011 04:32
Some functions related to breaking lists by a predicate
module Break
( breakEnd
, breakSep
, prop_breakEnd_sepPred
, prop_breakEnd_constPred
, prop_breakSep_firstSep
, prop_breakSep_falsePred
, prop_breakSep_truePred
, prop_breakSep_generalizesBreak
)
module SuccGroups where
import Control.Arrow ((&&&), first)
import Data.Function (on)
import Data.List
-- | Given two enumerable values, test whether the latter is the successor of
-- the former.
enumSucc :: (Enum a, Eq a) => a -> a -> Bool
@ion1
ion1 / SpiralArray.hs
Created August 1, 2011 11:34
Spiral array
{-# LANGUAGE ViewPatterns #-}
module SpiralArray where
import Control.Arrow
-- | Fill an array (a list of lists of integrals) with `indexFor`.
--
-- indices 7 returns:
--
@ion1
ion1 / FloatMinMax.hs
Created September 2, 2011 07:47
The minimum and maximum positive, finite floats
-- | The minimum and maximum positive, finite floats.
module FloatMinMax
( floatMin
, floatMaxDenorm
, floatMinNorm
, floatMax
)
where