Skip to content

Instantly share code, notes, and snippets.

View rpasta42's full-sized avatar

Anony Moose rpasta42

  • Florida
View GitHub Profile
#!/usr/bin/env bash
outputPaths=$(nix-build --no-out-link - <<'EOF'
let
pkgs = (import <nixpkgs> {});
# The book source
src = let
second-edition = fetchBook {
rev = "6354bb99d3834303693658890426a7ec6d4c104e";
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@lovasoa
lovasoa / LinkedList.rs
Last active March 13, 2018 17:47
Basic linked list implementation in Rust
enum List<T> {
Cons(T, Box<List<T>>),
Nil,
}
struct ListIterator<'a, T:'a> {
cur: &'a List<T>
}
impl<'a, T> Iterator<&'a T> for ListIterator<'a, T> {
@dtmilano
dtmilano / android-select-device
Last active November 29, 2023 09:29
Script to select one connected device or emulator when running adb
#! /bin/bash
#=====================================================================
# Selects an android device
# Copyright (C) 2012-2022 Diego Torres Milano. All rights reserved.
#
# The simplest way to invoke this script is creating a function like
# this one in your shell startup file:
#
# ```
# adb ()
@nvanderw
nvanderw / functors.py
Created August 21, 2012 07:19
Typeclass stuff in Python
import itertools
# Monad instance on a Python iterator, very similar to Haskell's list monad.
# In general, Haskell typeclass instances can be regarded as dictionaries which
# map the implemented function to its implementation. For a good explanation of
# this, see Philip Wadler's "Faith, Evolution, and Programming Languages"
# lecture. What this means for us is that we can write a function whose type
# signature in Haskell would be:
# Monad m => f m
#
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jboner
jboner / latency.txt
Last active May 4, 2024 21:16
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)