Skip to content

Instantly share code, notes, and snippets.

View sjsyrek's full-sized avatar

Steven Syrek sjsyrek

View GitHub Profile
@Daenyth
Daenyth / immutability.md
Created November 16, 2016 15:53
On Immutability

One benefit of using immutable values

When your values are immutable you are often forced to use a declarative style. This means you express what a value is, rather than imperatively building it up.

For example:

results = []
for x in values:
    results.append(func(x))

This common style of imperative code may seem simple at first, but when you read it, you as the reader must mentally construct a state machine and step by step reason about the state of mutation on each line.

@dwilkie
dwilkie / docker-cheat-sheat.md
Last active May 12, 2024 14:08
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@kanaka
kanaka / lang_rankings_2016_10.txt
Last active November 9, 2016 00:10
mal language popularity lists
Redmonk Jun 2016
http://redmonk.com/sogrady/2016/07/20/language-rankings-6-16/
Tiobe October 2016
http://www.tiobe.com/tiobe_index
PYPL Aug 2016
http://pypl.github.io/PYPL.html
Programming Language Popularity Chart
{-
DPLL from the textbook:
function DPLL(clauses, symbols, model ) returns true or false
if every clause in clauses is true in model then return true
if some clause in clauses is false in model then return false
P , value ← FIND-PURE-SYMBOL (symbols, clauses, model )
if P is non-null then return DPLL(clauses, symbols – P , model ∪ {P =value})
P, value ← FIND-UNIT-CLAUSE (clauses, model)
if P is non-null then return DPLL(clauses, symbols – P , model ∪ {P =value})
@alskipp
alskipp / filter_colors.hs
Last active January 6, 2024 07:23
Filtering arrays of enums (Haskell / Swift 1.2 / Swift 2.0 comparison)
-- data structure for RGBA, RGB & CMYK colors
data Color = RGBA Float Float Float Float
| RGB Float Float Float
| CMYK Float Float Float Float
deriving (Eq, Ord, Show)
-- list of colors
colors = [ RGBA 0.1 0.1 0.5 0.2
, RGBA 1 1 0 0.9
, RGB 0.5 0.5 0
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@datagrok
datagrok / vendoring.md
Last active November 3, 2023 17:37
"Vendoring" is a vile anti-pattern

"Vendoring" is a vile anti-pattern

What is "vendoring"?

From a comment on StackOverflow:

Vendoring is the moving of all 3rd party items such as plugins, gems and even rails into the /vendor directory. This is one method for ensuring that all files are deployed to the production server the same as the dev environment.

The activity described above, on its own, is fine. It merely describes the deployment location for various resources in an application.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 28, 2024 14:54
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname