Skip to content

Instantly share code, notes, and snippets.

View Kissaki's full-sized avatar

Jan Klass Kissaki

View GitHub Profile
@jboner
jboner / latency.txt
Last active May 26, 2024 07:33
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
@zdennis
zdennis / gist:2933686
Created June 14, 2012 23:42
Prompt additions for Git shell
#
# PLACE THE CONTENTS IN YOUR ~/.bashrc
# AFTERWARDS YOU'LL NEED TO RELOAD IT: source ~/.bashrc
#
# Colors
BLACK='\[\e[0;30m\]'
BLUE='\[\e[0;34m\]'
GREEN='\[\e[0;32m\]'
CYAN='\[\e[0;36m\]'
@hacst
hacst / .bashrc
Created January 15, 2013 12:30
Custom dash prompt which displays current branch and dirty status in the prompt line when in a git repository folder. Add to .bashrc or another file executed by it like .bash_aliases.
RS="\033[0m" # reset
HC="\033[1m" # hicolor
INV="\033[7m" # inverse background and foreground
function git_dirty() {
if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
echo -n "\[$INV\]*"
else
echo -n "\[$HC\]"
fi
@petarpetrovic
petarpetrovic / ownCloud 5 config file (nginx)
Created March 14, 2013 17:56
This is the proper config file for nginx and ownCloud version 5. Please note that slight variations might need to be applied in order for your particular instance to work. This one works for me, hence this Gist. Everyone is free to fork it and make proper modifications for different server configurations.
# This is the complete example of nginx configuration file for ownCloud 5
# This config file configures proper rewrite rules for the new release of ownCloud
# Also, this config file configures nginx to listen on both IPv4 and IPv6 addresses
# If you want it to listen to IPv4 address only, use listen 80; instead of listen [::]:80
# First, we configure redirection to HTTPS (substitue owncloud.example.com with the proper address of your OC instance)
server {
listen [::]:80;
server_name owncloud.example.com;
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@ninnemana
ninnemana / watcher.go
Created October 3, 2013 15:54
golang continuous compilation - monitors for file changes on and .go file recursively. assumes file containing main() is index.go
package main
import (
"fmt"
"github.com/str1ngs/util/file"
"log"
"os"
"os/exec"
"path/filepath"
"time"
@MichaelPote
MichaelPote / himawari.ps1
Created February 3, 2016 19:11
Windows Powershell Script to download the latest image from the Himawari-8 satelite, combine the tiles into a single image, convert to jpg and then set as the desktop background.
#
# Himawari-8 Downloader
#
#
#
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image,
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background.
#
# http://himawari8.nict.go.jp/himawari8-image.htm
#
@juanca
juanca / github_load_all_diffs.js
Created March 2, 2017 18:42
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 24, 2024 19:13
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).