Skip to content

Instantly share code, notes, and snippets.

View mbenke's full-sized avatar

Marcin Benke mbenke

  • Warszawa, Poland
View GitHub Profile
@mbenke
mbenke / Dockerfile
Created November 12, 2019 10:15
Dockerfile for rdkit 2019.09.1
FROM continuumio/miniconda3
RUN conda create -n golem-rdkit-env \
&& conda install --yes --freeze-installed -c rdkit -n golem-rdkit-env rdkit=2019.09.1 \
&& conda clean -afy
RUN echo "source activate golem-rdkit-env" > ~/.bashrc
@mbenke
mbenke / gist:d513306b453e08ec6093259924b3a8ce
Created August 9, 2019 14:14
Regex for rpc decorated defs
ag '( *)@rpc(.*)(\n\W*@.*)*\W*def\W+\w+(\((?U)([^)])*\))((?U).*):'
  1. Napisz funkcję triads :: Int -> [(Int,Int,Int)], ktora da liste trojek pitagorejskich ($x^2 + y^2 = z^2$ dla x,y,z <= n)

    W pierwszym podejsciu dostaniemy np.

    *Main> filter pyth $ triples 20
    [(3,4,5),(4,3,5),(5,12,13),(6,8,10),(8,6,10),(8,15,17),
      (9,12,15),(12,5,13),(12,9,15),(12,16,20),(15,8,17),(16,12,20)]
    
@mbenke
mbenke / SokobanCoord.hs
Created October 29, 2017 07:52
JNP3 Sokoban coordinates and direction handling
data Coord = C Integer Integer
data Direction = R | U | L | D
data World = W Coord Direction Maze
handleEvent :: Event -> World -> World
handleEvent (KeyPress key) (W pos direction maze) = W pos'' dir'' maze where
maybeDir = keyToDir key
(pos', dir'')
| Just dir' <- maybeDir = (moveCoordDir dir' pos, dir')
| otherwise = (pos, direction)
Starting debug for 'Hoogle'
[ERROR: alfred.workflow.input.scriptfilter] XML Parse Error 'The operation couldn’t be completed. (NSXMLParserErrorDomain error 76.)'. Row (null), Col (null): '(null)' in XML:
<?xml version='1.0'?>
<items>
<item arg="http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#t:Either" uid="http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#t:Either">
<title>data Either a b</title>
<subtitle>The Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b.
The Either type is sometimes used to represent a value which is either correct or an error; by convention, the Left constructor is used to hold an error value and the Right constructor is used to hold a correct value (mnemonic: "right" also means "correct"). </subtitle>
@mbenke
mbenke / chrome29.log
Created September 26, 2013 07:01
CoU log on Ununtu13.04, Chrome 29
[blocked] The page at https://googledrive.com/host/0B_dutxUROZMvUjF0MU9wODJqeU0/index.html ran insecure content from http://fonts.googleapis.com/css?family=Asap:400,700,400italic,700italic.
index.html:10
[blocked] The page at https://googledrive.com/host/0B_dutxUROZMvUjF0MU9wODJqeU0/index.html ran insecure content from http://fonts.googleapis.com/css?family=Lily+Script+One.
index.html:11
The page at https://googledrive.com/host/0B_dutxUROZMvUjF0MU9wODJqeU0/index.html displayed insecure content from http://c1.glitch.bz/misc/2012-11-06/loading.mp3.
index.html:1
[Year 31, 10, 38, 3, 11, 59] index.js:776
Resource interpreted as Font but transferred with MIME type font/woff: "https://themes.googleusercontent.com/static/fonts/nunito/v4/TttUCfJ272GBgSKaOaD7Kj8E0i7KZn-EPnyo3HZu7kw.woff".
Resource interpreted as Font but transferred with MIME type font/woff: "https://themes.googleusercontent.com/static/fonts/nunito/v4/0rdItLTcOd8TSMl72RUU5w.woff".
Resource interpreted as Font but transferred with MIME type font/wof
@mbenke
mbenke / gist:6710688
Created September 26, 2013 06:54
Console log of running CoU on Ubuntu 13.04, Firefox 24.0
[08:51:46.023] GET https://googledrive.com/host/0B_dutxUROZMvUjF0MU9wODJqeU0/index.html [HTTP/1.1 304 Not Modified 460ms]
[08:51:46.458] Use of getUserData() or setUserData() is deprecated. Use WeakMap or element.dataset instead. @ resource://gre/modules/XPIProvider.jsm -> jar:file:///home/ben/.mozilla/firefox/hgdms7e0.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js -> jar:file:///home/ben/.mozilla/firefox/hgdms7e0.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/lib/requestNotifier.js:64
[08:51:46.458] Blocked loading mixed active content "http://fonts.googleapis.com/css?family=Asap:400,700,400italic,700italic" @ https://googledrive.com/host/0B_dutxUROZMvUjF0MU9wODJqeU0/index.html
[08:51:46.460] Blocked loading mixed active content "http://fonts.googleapis.com/css?family=Lily+Script+One" @ https://googledrive.com/host/0B_dutxUROZMvUjF0MU9wODJqeU0/index.html
[08:51:46.540] GET https://fonts.googleapis.com/css?family=Nunito:400,700,300 [HTTP/1.1 200 OK 38ms]
[
@mbenke
mbenke / Nonum.hs
Created September 29, 2012 05:54
Code from "I am not a number, I am a free variable" by Conor McBride & James McKinna
-- McBride,McKinna "I am not a number"
module Nonum where
infixl 9 :$
infixr 6 :->
type Name = String -- FIXME
data Expr = F Name -- Free
| B Int -- Bound
| Expr :$ Expr
@mbenke
mbenke / gist:3775888
Created September 24, 2012 13:13
Make synctex work with Emacs 23.3.1 and evince 3.4
;; Based on http://tex.stackexchange.com/questions/29813/setup-synctex-with-emacs/49840#49840
;; replacing setf with setq
;; Use Evince as default viewer C-c C-v
(setq TeX-view-program-list '(("Evince" "evince %o"))
TeX-view-program-selection '((output-pdf "Evince")))
;;; Backward search Evince to AUCTeX adapted from http://www.emacswiki.org/emacs/AUCTeX#toc19
(add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)
(setq TeX-source-correlate-start-server t); Automatically start server without asking
@mbenke
mbenke / slowa3.txt
Created August 27, 2012 14:57 — forked from anonymous/gist:3488394
slowa testowe Dominika z 27.8.12
soczewki
"soczewki kontaktowe"
[szkła kontaktowe]
[soczewki kontaktowe]
[szkla kontaktowe]
tanie soczewki
najtańsze soczewki
"soczewki"
[soczewki]
[kontaktowe]