Skip to content

Instantly share code, notes, and snippets.

@karmi
karmi / .gitignore
Created March 16, 2012 16:09
Bootstrap, install and configure ElasticSearch with Chef Solo
.DS_Store
Gemfile.lock
*.pem
node.json
tmp/*
!tmp/.gitignore
@jboner
jboner / latency.txt
Last active June 9, 2024 15:21
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
anonymous
anonymous / make_otp_dumper.py
Created October 29, 2012 10:24
Creates a bootcode.bin for dumping the OTP storage area over serial (gpio 14,15 : http://elinux.org/RPi_Low-level_peripherals#General_Purpose_Input.2FOutput_.28GPIO.29 )
import os
r0 = 0
r1 = 1
r2 = 2
r3 = 3
r4 = 4
r5 = 5
r6 = 6
r7 = 7
@glombard
glombard / deployment.properties
Created October 30, 2013 10:50
Java Applet Configuration and Registry Settings. This is my development environment settings for testing applet development: security set to MEDIUM and Java Console enabled.
#deployment.properties
#Wed Oct 30 02:55:51 PDT 2013
deployment.security.level=MEDIUM
deployment.javapi.lifecycle.exception=true
deployment.trace=true
deployment.version=7.21
deployment.browser.path=C\:\\Program Files\\Internet Explorer\\iexplore.exe
deployment.modified.timestamp=1383126951687
deployment.expiration.decision.10.45.2=undefined
deployment.log=true
#Requires -Version 3.0
#Requires -Module DnsClient,ActiveDirectory
<#
.SYNOPSIS
Practice Event of Powershell Winter Scripting 2014
.DESCRIPTION
Practice Event of Powershell Winter Scripting 2014
@n8henrie
n8henrie / gps.py
Created September 7, 2014 18:23
Pythonista script to get GPS coordinates and text them via Launch Center Pro
#! /usr/bin/env python
'''gps.py
A quick and dirty Pythonista script for texting your GPS location. Uses
Pythonista: http://n8h.me/1dntsEH
and
Launch Center Pro: http://n8h.me/1fcRfrn
Recommended LCP URL action:
pythonista://{{gps}}?action=run
'''
@domenic
domenic / v8-versions.md
Last active December 11, 2020 01:45
V8 versions for embedders

Embedders of V8 should generally use the head of the branch corresponding to the minor version of V8 that ships in Chrome.

Finding the minor version of V8 corresponding to the latest stable Chrome

To find out what version this is,

  1. Go to https://omahaproxy.appspot.com/
  2. Find the latest stable Chrome version in the table
  3. Enter it into the "Translate a Chrome verison to a V8 version" box below the table.
  4. Ignore the last two parts.
CFLAGS=-ggdb3
PATH=/opt/mono/bin/:$PATH
./autogen.sh #--enable-werror
make -w
(cd mcs && make -w test) # build tests separately, so we can catch compilation errors that would be ignored in the next step
make -k -w check CI=1 V=1 TEST_HARNESS_VERBOSE=1 || true
rm -r /tmp/jenkins-temp-aspnet*
#!/usr/bin/env python
# -*- coding: utf-8 vi:noet
# Dump a clear-text version of an SSH key from gpg-agent
__author__ = "Jérôme Carretero <cJ-tub@zougloub.eu>"
__licence__ = "MIT"
import sys, io, subprocess, re, ctypes
libgcrypt = ctypes.CDLL("libgcrypt.so")
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active June 6, 2024 14:08
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"