Skip to content

Instantly share code, notes, and snippets.

#{ stdenv, fetchurl, python3Packages }:
with import <nixpkgs> {};
python3Packages.buildPythonApplication rec {
name = "foobar";
version = "0.23.23.44";
meta = {
description = "foobar tool";
};
@alech
alech / stack.txt
Created August 6, 2018 11:10
stack ghc install problem
[alech@air:~]$ stack ghci
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.
Running /run/current-system/sw/bin/make install in directory /home/alech/.stack/programs/x86_64-linux/ghc-8.4.3.temp/ghc-8.4.3/ exited with ExitFailure 2
/run/current-system/sw/bin/make --no-print-directory -f ghc.mk install BINDIST=YES NO_INCLUDE_DEPS=YES
"rm" -f utils/ghc-pkg/dist-install/build/Version.hs
echo "module Version where" >> utils/ghc-pkg/dist-install/build/Version.hs
echo "version, targetOS, targetARCH :: String" >> utils/ghc-pkg/dist-install
import Combine exposing (..)
import Combine.Char exposing (..)
import String
import Char
flattenStringList : List String -> String
flattenStringList =
List.foldr (++) ""
comment : Parser String
@alech
alech / foo.html
Created October 8, 2015 18:22
foo
foobar
alech@zoe:~$ crontab -l|grep backup_sessionstore
*/5 * * * * /home/alech/bin/backup_sessionstore.sh
alech@zoe:~$ cat bin/backup_sessionstore.sh
#!/bin/sh
cp /home/orange/.mozilla/firefox/7jyhhf5c.default/sessionstore.js /home/alech/tmp/backup_sessionstore/sessionstore.js
cd /home/alech/tmp/backup_sessionstore
git commit -a -m 'automatic backup'
@alech
alech / $
Created February 19, 2013 09:25
To make it able to paste stuff like $ git clone ... directly into your shell
#!/bin/sh
PROGNAME=$1
shift
$PROGNAME $@
@alech
alech / suspend_temp_battery.rb
Created October 6, 2012 19:12
little hack to suspend when battery is low or temperature is too high
#!/usr/bin/env ruby
a = `acpi`
if a[/Discharging/] then
# battery is discharging, check if we are below 3%
perc = a[/(\d+)%/, 1]
if perc.to_i <= 3 then
log = open '/tmp/debuglog', 'w'
log.puts "Battery discharging, percentage <= 3"
log.close
@alech
alech / gist:3763299
Created September 21, 2012 19:12
Do not use cursor keys in vim!
function WarningMessage(msg)
echohl WarningMsg
echo a:msg
echohl Nothing
endfunction
nnoremap <LEFT> :call WarningMessage("Use h!")<CR>h
nnoremap <DOWN> :call WarningMessage("Use j!")<CR>j
nnoremap <UP> :call WarningMessage("Use k!")<CR>k
nnoremap <RIGHT> :call WarningMessage("Use l!")<CR>l
@alech
alech / gist:3763293
Created September 21, 2012 19:11
Do not use cursor keys in vim!
function WarningMessage(msg)
echohl WarningMsg
echo a:msg
echohl Nothing
endfunction
nnoremap <LEFT> :call WarningMessage("Use h!")<CR>h
nnoremap <DOWN> :call WarningMessage("Use j!")<CR>j
nnoremap <UP> :call WarningMessage("Use k!")<CR>k
nnoremap <RIGHT> :call WarningMessage("Use l!")<CR>l
@alech
alech / cat.hs
Created August 17, 2012 23:04
cat in haskell
import System.IO
import System.Environment
import Data.Maybe
import System.Directory
main :: IO ()
main = do
hSetBuffering stdout NoBuffering
args <- getArgs
let files = case args of