Skip to content

Instantly share code, notes, and snippets.

View mnorbi's full-sized avatar

Norbert Madarasz mnorbi

  • -
  • Zürich, Switzerland
View GitHub Profile
@mnorbi
mnorbi / .brew
Created March 10, 2019 06:14 — forked from joshchu/.brew
Salsify ~/.brew
#!/bin/bash
sudo -v # ask for password only at the beginning
brew update
brew upgrade
brew tap homebrew/versions
brew tap phinze/homebrew-cask
brew install brew-cask
@mnorbi
mnorbi / terse-python.md
Last active March 5, 2019 06:20
Terse python code examples

Sparse matrix multiplication (credit: Pochmann)

def multiply(self, A, B):
    cols = [[(j, b) for j, b in enumerate(col) if b]
            for col in zip(*B)]
    return [[sum(row[j]*b for j, b in col)
             for col in cols]
            for row in A]
@mnorbi
mnorbi / gist_feed.md
Last active November 26, 2019 09:14
Random gists along the road with descriptions

Jenkins Dynamic Parallel Stages

pipeline {
	agent any
	parameters {
		string(
			name: 'APP_VERSION',
			defaultValue: '3.0.0-SNAPSHOT',
			description: 'Version of app to run'
		)
@mnorbi
mnorbi / latency.txt
Created February 7, 2019 04:23 — forked from eshelman/latency.txt
HPC-oriented Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference/hit 1.5 ns 4 cycles
Floating-point add/mult/FMA operation 1.5 ns 4 cycles
L2 cache reference/hit 5 ns 12 ~ 17 cycles
Branch mispredict 6 ns 15 ~ 20 cycles
L3 cache hit (unshared cache line) 16 ns 42 cycles
L3 cache hit (shared line in another core) 25 ns 65 cycles
Mutex lock/unlock 25 ns
L3 cache hit (modified in another core) 29 ns 75 cycles
@mnorbi
mnorbi / BinaryTreeInOrderTraversal.java
Last active May 17, 2018 03:57
binary tree in order traversal
//https://leetcode.com/problems/binary-tree-inorder-traversal/description/
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/