Skip to content

Instantly share code, notes, and snippets.

View dpwiz's full-sized avatar
👁️‍🗨️
🌈

Alexander Bondarenko dpwiz

👁️‍🗨️
🌈
View GitHub Profile

Keybase proof

I hereby claim:

  • I am wiz on github.
  • I am icrbow (https://keybase.io/icrbow) on keybase.
  • I have a public key whose fingerprint is E668 2607 B758 0805 1067 4682 2F0A 0425 06CA B9F6

To claim this, I am signing this object:

@dpwiz
dpwiz / massblock.js
Last active August 29, 2015 14:22
Twitter follower spam cleanup
// Open http://twitblock.org/ and scan yourself,
// then set a robot to press block buttons (gently).
var go = function() {
var btn = $(".block-button").not('.blocked').not('.error').first();
console.debug(btn.parent().find('a.screen-name > span').text());
if (btn.length) {
btn.click();
setTimeout(go, 2000);
}
@dpwiz
dpwiz / yesod-devel.sh
Created June 8, 2015 12:27
Run yesod devel within the current (stackage-shared) sandbox
SANDBOX=`python -c 'print([l.split()[-1] for l in open("cabal.sandbox.config") if "prefix" in l][0])'`
PATH=$SANDBOX/bin:$PATH yesod devel -p 1234
import Data.Char
e=181021504832735228091659724090293195791121747536890433
u(f,m)x=i(m(x), [],let(a,b)=f(x) in(a:u(f,m)b))
(v,h)=(foldr(\x(y )->00+128*y+x)0,u( sp(25),((==)"")))
p::(Integer,Integer )->Integer -> Integer --NotInt
p(n,m)x =i(n==0 ,1,i(z n ,q(n,m)x, r(n,m)x))
i(n,e,d )=if(n) then(e) else (d) --23+3d4f
(g,main ,s,un)= (\x->x, y(j),\x->x*x,unlines)--)
j(o)=i(take(2)o== "e=","e="++t (drop(4-2)o),i(d>e,k,l)o)
# via: http://blog.codinghorror.com/sorting-for-humans-natural-sort-order/
import re
def sort_nicely_inplace(l):
""" Sort the given list in the way that humans expect.
P.S. Beware of unicode and other i18n crap!
"""
convert = lambda text: int(text) if text.isdigit() else text
alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
@dpwiz
dpwiz / FiraCode-caret.sh
Created November 16, 2015 13:03
Patch FiraCode back into Caret after updates.
cp ~/Downloads/FiraCode-Regular.ttf ~/Extensions/fljalecfjciodhpcledpamjachpmelml/*/css/
cp ~/Extensions/fljalecfjciodhpcledpamjachpmelml/*/css/caret-dark.css /tmp/caret-dark.css
echo '
@font-face {
font-family: FiraCode;
src: url(FiraCode-Regular.ttf);
}
' > ~/Extensions/fljalecfjciodhpcledpamjachpmelml/*/css/caret-dark.css
cat /tmp/caret-dark.css >> ~/Extensions/fljalecfjciodhpcledpamjachpmelml/*/css/caret-dark.css
@dpwiz
dpwiz / dumpdata.sh
Last active June 2, 2016 06:43
dump django data for later loading into empty db (e.g. server migration)
./manage.py dumpdata --exclude=auth.permission --exclude=contenttypes --exclude sessions --exclude admin --natural-foreign --indent=2 | xz -9 > dump-`date +%Y%m%d`.json.xz
@dpwiz
dpwiz / hostname.conf
Last active January 30, 2016 07:12
nginx multihost http2 config with a+ rating
server {
listen 80;
server_name hostname.tld *.hostname.tld;
location / {
return 301 https://$host$request_uri;
}
location /.well-known/acme-challenge {
root /ext/www/public_html/le-challenge;

distributed-process-0.6.0

2016-02-18 Facundo Domínguez [email protected] 0.6.0

  • Have nsendRemote skip the transport for local communication.
  • Unsafe primitives for usend and nsendRemote.
  • Stop using the transport for local communication.
  • Skip the transport for whereisRemoteAsync and registerRemoteAsync.
  • Have nsendRemote skip the transport for local communication.
  • Have runProcess forward exceptions.
module Room
( roomProcess
, roomService
-- Client API
, joinRoom
, partRoom
, sendRoom
, listRoom
-- Server API is private
) where