Skip to content

Instantly share code, notes, and snippets.

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

Alexander Bondarenko dpwiz

👁️‍🗨️
🌈
View GitHub Profile
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)
@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
@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);
}

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 / Main.elm
Created March 18, 2015 19:27
Render, minify and compress Elm project.
module Main where
import Html (..)
import Html.Attributes (..)
import Html.Events (..)
import List
import LocalChannel as LC
import Signal
-- Model
@dpwiz
dpwiz / scarf.yaml
Last active August 29, 2015 14:13
demo scarf config
# Usage:
# $ wget http://hipstername.tld/download/linux-x64/scarf && chmod +x scarf
# $ ./scarf gist:wiz/c32460e1ecbf612bb12f
title: Demo template
source: github:login/reponame
params:
- key: spam
title: Spam
@dpwiz
dpwiz / mini.elm
Last active April 27, 2019 01:46
A minimal Elm application with AJAX and Virtual DOM.
import Debug
import Graphics.Input as Input
import Html
import Html (..)
import Html.Attributes (..)
import Html.Events (..)
import Html.Tags (..)
import Http
import Window
@dpwiz
dpwiz / Client.hs
Created August 25, 2014 10:33
JSON-RPC client
module JSONRPC.Client where
import Control.Applicative ((<|>))
import Data.Aeson (encode, decode)
import Data.Aeson.Types
import Network.HTTP.Conduit
import qualified Data.Text as T
import qualified Data.ByteString.Lazy.Char8 as BSL
data (FromJSON a) => JSONRPCReply a =
@dpwiz
dpwiz / PlainOldXML.hs
Created August 19, 2014 08:24
Unviersal wrapper for POX protocols.
module PlainOldXML where
import Network.HTTP.Conduit
import Text.XML
import Text.XML.Cursor
xmlQuery :: Manager -> String -> Document -> IO Cursor
xmlQuery manager url doc = do
putStrLn "Request:" >> BSL.putStrLn (renderLBS (def { rsPretty = True }) doc)
@dpwiz
dpwiz / haskell.nanorc
Last active August 29, 2015 14:02
DIY Haskell IDE
## include "/path/to/haskell.nanorc"
syntax "haskell" "\.hs$"
color green "(\||@|!|:|_|~|=|\\|;|\(|\)|,)"
color magenta "(True|False|==|/=|&&|\|\||<|>|<=|>=)"
color green "(->|<-|!)"
color red "[\n\t](as|case|of|class|data|default|deriving|do|forall|foreign|hiding|if|then|else|import|infix|infixl|infixr|instance|let|in|mdo|module|newtype|qualified|type|where)[ \n\t]"
color brightblue "'.'"
color brightblue "'\\[ntfr]'"
color brightblue ""[^\"]*""