Skip to content

Instantly share code, notes, and snippets.

@jorotenev
jorotenev / readme.md
Created February 11, 2018 14:43
NativeScript JSON schema validation
@jorotenev
jorotenev / workflow.md
Last active July 26, 2019 09:37
Workflow for git subtree
./thesis
├── docker-compose.yaml
├── micrsoserviceX
├── micrsoserviceY
├── memory-engine

Subtree workflows

Adapted from here. Below is an executive summary for the use case of a university collaborative thesis project.

@dmpop
dmpop / unsplash-random.sh
Last active September 18, 2017 21:31
Use random photos from Unsplash as a desktop background on Ubuntu
#!/bin/bash
uuser="unsplash_user_name"
path="path/to/dir"
size=$(xdpyinfo | grep dimensions | awk '{print $2}')
curl "https://source.unsplash.com/user/$uuser/$size" --location --output $path/unsplash-random.jpeg
gsettings set org.gnome.desktop.background picture-uri file://$path/unsplash-random.jpeg
@hirobert
hirobert / flask_abort_example.py
Created January 13, 2016 20:38
flask abort as json
from flask import abort, make_response, jsonify
abort(make_response(jsonify(message="Message goes here"), 400))
@colinvh
colinvh / aws.md
Last active July 22, 2024 10:24
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@psayre23
psayre23 / gist:c30a821239f4818b0709
Last active June 27, 2024 17:48
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@ghaering
ghaering / gist:9f05a362489d3ea5c9c6
Created May 5, 2014 13:57
change to new salt master
service salt-minion stop
rm -f /etc/salt/pki/minion/minion_master.pub
echo "master: salt" > /etc/salt/minion
service salt-minion start
@jboner
jboner / latency.txt
Last active July 26, 2024 04:31
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