Skip to content

Instantly share code, notes, and snippets.

View manpages's full-sized avatar

Jonn Mostovoy manpages

View GitHub Profile
:f bower_components/purescript-prelude/src/Prelude.js
:m bower_components/purescript-prelude/src/Prelude.purs
:f bower_components/purescript-eff/src/Control/Monad/Eff.js
:m bower_components/purescript-eff/src/Control/Monad/Eff.purs
:f bower_components/purescript-console/src/Control/Monad/Eff/Console.js
:m bower_components/purescript-console/src/Control/Monad/Eff/Console.purs
:f bower_components/purescript-eff/src/Control/Monad/Eff/Unsafe.js
:m bower_components/purescript-eff/src/Control/Monad/Eff/Unsafe.purs
import Prelude
import Control.Monad.Eff.Console
@manpages
manpages / bitmask.py
Created August 10, 2015 10:11
Get your bitmask!
if __name__ == "__main__":
zzz = (s.run("""
select distinct powerScore from scores
"""))[1]
z = 0
for x in zzz:
print(bin(z))
y = int(x[0]) #here goes the poweScore mask for a submission
z = z | y
print(bin(z))
@manpages
manpages / polyeof.hs
Created July 17, 2015 01:24
Polymorphic eof
type PE a = Either ParseError a
raw :: IO String
raw = readFile "real.data"
date :: Parsec String a String
date = extract
where
extract = string "Date: " *> many1 (noneOf "\n") <* newline
@manpages
manpages / mysql.php
Last active August 29, 2015 14:24
Monadic MySQLi, take I
<?php
include_once('./lib/utils.php');
function rtn() {
$xs = func_get_args();
$y = call_user_func_array('mysqli_prepare', $xs);
if ($y === false)
die(nok( 'MySQL Error: ' . hesc(mysqli_error($xs[0])) ));
return $y;
@manpages
manpages / let.hs
Created June 23, 2015 23:16
Let elimination example
{- let-elimination example -}
g x = (x, x - 1)
h = (42 +)
f = \x -> let (_,z) = g x in h z
f' = h . fst . g
@manpages
manpages / withNixInstallHydra.sh
Created April 20, 2015 01:10
Given Nix, the package manager; install Hydra.
if [ -f ~/hydra/install.lock ]; then
echo 'Found installation lock file, to force hydra update, remove ~/hydra/install.lock and re-run this script'
exit 2
fi
nix-channel --remove http://hydra.nixos.org/jobset/hydra/master/channel/latest
nix-channel --add http://hydra.nixos.org/jobset/hydra/master/channel/latest hydra-master-latest
nix-channel --update
nix-env -i hydra postgresql
mkdir -p ~/hydra 2>/dev/null 1>/dev/null
initdb -D ~/hydra/db 2>/dev/null 1>/dev/null
@manpages
manpages / usage.md
Created March 2, 2015 00:09
issues-usage
Currently supported verbs: 

  + init:                 initializes directory structure, populates .issues/config
  + pull:                 pulls or clones the repository with accordance to .issues/config
  + add(a):               adds an issue with random four-symbol id
                          example: issues add 'Write a manual page for the tool'
  + add-named(an):        adds a named issue. keep the name short and distinct
                          example: issues add-named man 'Write a manual page for the tool'
  + sub(s):               includes a sub-issue with random four-symbol id into a parent issue
@manpages
manpages / it-works.txt
Created March 2, 2015 00:08
It works!
```
λ issues tree commentTags
| ISSUE: /commentTags/
| status: open
| tags: untagged
| author: Jonn Mostovoy <amarr.industrial@gmail.com>
| title: Implement tags for commentaries
| Implement tags for commentaries
| ---
|
@manpages
manpages / forProxyGuy.full.json
Created February 20, 2015 16:42
Magic: the Gathering cards with multiple keywords
This file has been truncated, but you can view the full file.
{ layout: 'normal',
name: 'Black Knight',
manaCost: '{B}{B}',
cmc: 2,
colors: [ 'Black' ],
type: 'Creature — Human Knight',
types: [ 'Creature' ],
subtypes: [ 'Human', 'Knight' ],
text: 'First strike (This creature deals combat damage before creatures without first strike.)\nProtection from white (This creature can\'t be blocked, targeted, dealt damage, or enchanted by anything white.)',
@manpages
manpages / conky.md
Created January 15, 2015 03:21
Suspicious conky -v output on nixos

In overrides:

 conkyX11Rss = pkgs.conky.override { x11Support=true;
                                     wireless=true;
                                     luaSupport=true;
                                     rss=true;
                                   };