Skip to content

Instantly share code, notes, and snippets.

View adamczykm's full-sized avatar
💭
Hi.

Michał Adamczyk adamczykm

💭
Hi.
  • Neighbouring Plane
View GitHub Profile
module Svg2PngPrintForm where
import Control.Applicative (pure, when)
import Control.Bind (bind, (=<<), (>>=))
import Control.Category ((<<<))
import Data.BooleanAlgebra ((||))
import Data.Eq ((/=))
import Data.Function (($))
import Data.Int (fromString)
import Data.Maybe (Maybe(..), fromMaybe)
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Serialization where
import Protolude
import Data.Binary
@adamczykm
adamczykm / multiple_ssh_setting.md
Created February 2, 2018 01:36 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@adamczykm
adamczykm / list-dirs-recursively.el
Created September 12, 2017 00:29
List subdirectories recursively in emacs lisp (elisp),
(defun list-dirs-recursively (dir &optional include-symlinks)
"Return list of all subdirectories recursively. Returns absolute paths.
Optionally call recursively on symlinks."
(let ((result nil)
(tramp-mode (and tramp-mode (file-remote-p (expand-file-name dir)))))
(dolist (file (file-name-all-completions "" dir))
(when (and (directory-name-p file) (not (member file '("./" "../"))))
(setq result (nconc result (list (expand-file-name file dir))))
(let* ((leaf (substring file 0 (1- (length file))))
(full-file (expand-file-name leaf dir)))
@adamczykm
adamczykm / mediator.c
Created January 8, 2016 16:56 — forked from ashelly/mediator.c
Running Median. Finds the median of the last K inputs in O(lg K). See http://stackoverflow.com/q/5527437/10396 for some details.
//Copyright (c) 2011 ashelly.myopenid.com under <http://www.opensource.org/licenses/mit-license>
#include <stdlib.h>
//Customize for your data Item type
typedef int Item;
#define ItemLess(a,b) ((a)<(b))
#define ItemMean(a,b) (((a)+(b))/2)
typedef struct Mediator_t
import GHC.Show (intToDigit)
-- | Fast hex representation of Word8
showHex :: Word8 -> ShowS
showHex n0 = showIt (1 :: Int) (quotRem n0 16)
where
showIt x (n,d) r = seq c $ -- stricter than necessary
case x of
0 -> r'
_ -> showIt (x-1) (quotRem n 16) r'
(global-set-key (kbd "C-x m") nil)
(global-set-key (kbd "C-x m >") 'mc/mark-next-like-this)
+(NSObject*)extractSexp:(const Sexp*)s{
if(s==NULL) return nil;
switch (s->type) {
case Bool:
return [NSNumber numberWithBool:(*(int*)s->value)!=0];
case Integer:
return [NSNumber numberWithInteger:(*(int*)s->value)];
case Double:
return [NSNumber numberWithDouble:(*(double*)s->value)];
case String:
import pandas as pd
import pyqtgraph as pq
import numpy as np
import matplotlib.mlab as mlab
import pylab
from matplotlib.cm import Accent
def PlotCustomSpectrogram(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=128,
{-# LANGUAGE OverloadedStrings #-}
module ParsePlist ( parseFromPlist
, plistParser
, plistParserWithHeaderAndFooter
, defaultHeader
, defaultFooter
, parseXexpr
)where
import Control.Monad