Skip to content

Instantly share code, notes, and snippets.

View np's full-sized avatar

Nicolas Pouillard np

View GitHub Profile
#!/bin/bash
# Walk-through (without changing the configuration):
# $ mkdir ~/.agda-pkg
# $ cd ~/.agda-pkg
# $ mkdir github patchtag
# $ darcs get --lazy http://www.cse.chalmers.se/~nad/repos/lib/ stdlib
# $ mkdir github/crypto-agda
# $ cd github/crypto-agda
# $ git clone https://github.com/crypto-agda/agda-nplib
@np
np / asking.sh
Last active December 14, 2015 15:28
A shell function to ask the user to answer a Yes/No question.
# asking() @ https://gist.github.com/np/5107721#file-asking-sh {{{
# Dependencies:
# error() @ https://gist.github.com/np/3736727#file-error-sh
# Options:
# --default=no Makes No being the default (--default=yes is the default)
# --no-slmenu Do no use slmenu even if available
# Examples:
# asking 'Something failed, do you still want to continue?'
# asking --default=yes 'Next step?'
asking(){
@np
np / timestamps
Last active October 26, 2015 11:49
c691e1b19a5e46d63eeaa37a455b6e74de9890ee
d6b02c6055b6bd4253ced4b0ad91070481032c76
@np
np / error.sh
Last active October 10, 2015 19:07
Simple 'error' function in shell
# error() @ https://gist.github.com/np/3736727#file-error-sh {{{
# Takes an exit code and a message, prints the message and then exits
error(){
local code="$1"
shift
echo "error: $@" >>/dev/stderr
exit "$code"
}
# }}}
@np
np / link.sh
Last active October 7, 2015 14:48
link
@np
np / namecoin-update.rb
Last active October 4, 2015 19:28 — forked from comboy/update.rb
update all your namecoin domains
#!/usr/bin/ruby
require 'json'
JSON.load(`namecoind name_list`).each do |domain|
if domain['expires_in'] < 5000
command = "namecoind name_update '#{domain['name']}' '#{domain['value']}'"
puts command
puts `#{command}`
end
end
@np
np / git-trash.sh
Created May 7, 2012 05:42
Move files to a trash branch
#!/bin/bash
set -e
error(){
echo "$@" >>/dev/stderr
exit 1
}
GIT_TRASH_FILE=.git/trash.idx
remotes=(origin)
@np
np / cmdcheck
Created November 24, 2011 23:28
cmdcheck & cmdrecord
#!/bin/bash -e
# Current bashisms are:
# a=(foo bar baz)
# ${foo[@]}
# $(bar)
# local
# (( bar ))
# for i; do; ...; done is not a bashism, right?
@np
np / git-ignore.d
Created November 22, 2011 13:22
git-ignore.d
#!/bin/bash
# vim: ft=sh
###########################################################################
# Copyright (c) 2011, Nicolas Pouillard
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
module Yi.Char.Unicode (greek, symbols, subscripts, superscripts, checkAmbs, disamb) where
import Data.List (isPrefixOf)
import Control.Applicative
greek :: [(String, String)]
greek = [(name, unicode) | (_,name,unicode) <- greekData] ++
[ ([leading,shorthand],unicode)
| (Just shorthand,_,unicode) <- greekData
, leading <- ['\'', 'g'] ]