Skip to content

Instantly share code, notes, and snippets.

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

Alexander Bondarenko dpwiz

👁️‍🗨️
🌈
View GitHub Profile
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Main where
import Apecs
import Apecs.Physics

Keybase proof

I hereby claim:

  • I am dpwiz on github.
  • I am icrbow (https://keybase.io/icrbow) on keybase.
  • I have a public key whose fingerprint is DB13 7C80 CB83 D703 C813 97C1 47DA E604 896D 2914

To claim this, I am signing this object:

@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 / fix-fias.json
Created December 9, 2012 10:52
Импорт DBF ФИАС в PostgreSQL
{
"actstat": {
"convert": {
"actstatid": "int"
}
},
"addrobj": {
"null": [
"actstat",
"nextid",
@dpwiz
dpwiz / base.tex
Last active August 7, 2017 18:50
Render LaTeX code generated with Django templates to a PDF response.
\documentclass[a4paper]{article}
% Cyrillic support
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\DeclareSymbolFont{T2Aletters}{T2A}{cmr}{m}{it}
% PDF search & cut'n'paste
\usepackage{cmap}
@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 / twitsearch.hs
Last active April 11, 2017 09:23
Haskell version of http://eax.me/scala/
import Data.Aeson
import Network.HTTP
import System.Environment (getArgs)
import Control.Monad (mapM_)
import Data.Maybe (fromMaybe)
import qualified Data.ByteString.Lazy.Char8 as LBS
import qualified Data.Text as T
import qualified Data.HashMap.Strict as HM
@dpwiz
dpwiz / buildenv.sh
Created February 28, 2011 19:02
Prepare to deploy stuff
mkdir -p reports
REPO="http://127.0.0.1:8888"
echo Checking for local repo at ${REPO}
curl -f --head ${REPO} > /dev/null 2>&1 || REPO='http://pypi.python.org/simple'
echo "... will use ${REPO}"
echo 'Creating "venv" environment...'
virtualenv --distribute --no-site-packages venv
@dpwiz
dpwiz / scotty-auth.hs
Last active August 31, 2016 14:28
Check Basic HTTP Authentication in Scotty
main :: IO ()
main = scotty 3000 app
app :: ScottyM ()
app = do
rcon <- liftIO $ R.connect R.defaultConnectInfo {R.connectPort = R.UnixSocket "redis.sock"}
get "/favicon.ico" $ html "ಠ_ಠ"
get "/:method" $ do
@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