Skip to content

Instantly share code, notes, and snippets.

Avatar

Filip Krikava fikovnik

View GitHub Profile
@fikovnik
fikovnik / tg2p.st
Created Dec 20, 2021 — forked from jdevoo/tg2p.st
Not so Terse Guide to Pharo
View tg2p.st
"**************************************************************************
* Allowable characters: *
* - a-z *
* - A-Z *
* - 0-9 *
* - .+/\*~<>@%|&? *
* - blank, tab, cr, ff, lf *
* *
* Variables: *
* - variables must be declared before use *
View r-build.sh
#!/bin/sh
export CXXFLAGS="-O2 -ggdb3"
export CPPFLAGS="-O2 -ggdb3"
export CFLAGS="-O2 -ggdb3"
export R_KEEP_PKG_SOURCE=yes
export CXX="g++"
./configure --with-blas --with-lapack --without-ICU --with-x \
--with-tcltk --without-aqua --with-recommended-packages \
@fikovnik
fikovnik / r-build-gdb.sh
Created Oct 11, 2021
Build R for debugging
View r-build-gdb.sh
#!/bin/sh
export CXXFLAGS="-O0 -ggdb3"
export CPPFLAGS="-O0 -ggdb3"
export CFLAGS="-O0 -ggdb3"
export R_KEEP_PKG_SOURCE=yes
export CXX="g++"
./configure --with-blas --with-lapack --without-ICU --with-x \
--with-tcltk --without-aqua --with-recommended-packages \
View screen-24bit.terminfo
# From [[info:efaq#Colors%20on%20a%20TTY][Colors on a TTY]]
# Use colon separators.
screen-24bit|screen with 24-bit direct color mode,
use=screen-256color,
setb24=\E[48:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,
setf24=\E[38:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,
# Use semicolon separators.
screen-24bits|screen with 24-bit direct color mode,
use=screen-256color,
setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,
View GreekNumbers.scala
val G1 = List("α", "β", "γ", "δ", "ε", "ϛ", "ζ", "η", "θ")
val G10 = List("ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ϙ")
val G100 = List("ρ", "σ", "τ", "υ", "φ", "χ", "ψ", "ω", "ϡ")
val G1000 = List("", "", "", "", "", "", "", "", "")
@fikovnik
fikovnik / latency.markdown
Created Jul 3, 2019 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
View org-insert-clipboard-image.el
(defun org-insert-clipboard-image ()
(interactive)
(setq dir (concat (file-name-directory (buffer-file-name)) "resources"))
(unless (file-directory-p dir) (make-directory dir))
(setq filename
(concat dir
"/"
(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))
"-"
(format-time-string "%Y%m%d-%H%M%S")
@fikovnik
fikovnik / emacs.plist
Created Oct 3, 2018
emacs services on OSX
View emacs.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>emacs</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/emacs</string>
<string>--fg-daemon</string>
View cvimrc
let defaultengine = "duckduckgo"
let blacklists = ["http://prl4/*"]
View evals-in-R-code.Rmd
---
title: "R Notebook"
output: html_notebook
---
```{r}
library(readr)
library(devtools)
library(dplyr)
library(stringr)