Skip to content

Instantly share code, notes, and snippets.

@tdd
tdd / gitconfig.ini
Last active July 24, 2024 04:11
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = your@email.tld
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
@scottjehl
scottjehl / getViewportSize.js
Created March 16, 2012 19:25
Reliably get viewport dimensions in JS
/*!
An experiment in getting accurate visible viewport dimensions across devices
(c) 2012 Scott Jehl.
MIT/GPLv2 Licence
*/
function viewportSize(){
var test = document.createElement( "div" );
test.style.cssText = "position: fixed;top: 0;left: 0;bottom: 0;right: 0;";
@rapidrapids
rapidrapids / 4095.css
Created March 28, 2012 12:09
IE CSS Selector test (4095)
#test2 { background-color: red ;}
#test2 { background-color: red ;}
#test2 { background-color: red ;}
#test2 { background-color: red ;}
#test2 { background-color: red ;}
#test2 { background-color: red ;}
#test2 { background-color: red ;}
#test2 { background-color: red ;}
#test2 { background-color: red ;}
#test2 { background-color: red ;}
@nixme
nixme / acr122u.rb
Created May 17, 2012 08:00
Read NFC tag IDs from a Tagstand ACR122U USB reader
# Quick and dirty script to read unique IDs from NFC tags using the ACR122U USB
# reader.
#
# PC/SC-based API details for the ACR122U available at
# http://acs.com.hk/drivers/eng/API_ACR122U_v2.01.pdf
#
# Assumes ruby >= 1.9.2
# `gem install smartcard` first
#
@jboner
jboner / latency.txt
Last active July 30, 2024 02:24
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
@tlberglund
tlberglund / git-loglive
Last active January 12, 2024 03:40
Log Live Git Command
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
@ydbondt
ydbondt / loglive
Created October 12, 2012 13:40
Log live for Git
#!/bin/bash
watch --color "git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all -20"
@opi
opi / gist:6078227
Last active June 8, 2017 09:52
Simple social links extra_field for drupal.
<?php
// Social share links
$links = array();
$share_url = url('node/'.$node->nid, array('absolute' => TRUE));
$links['facebook'] = array(
'href' => 'https://www.facebook.com/sharer/sharer.php?u='.$share_url,
'title' => t("Facebook"),
'attributes' => array(
'data-popup-width' => 700,
@eimajtrebor
eimajtrebor / darktable-workflow.md
Last active June 12, 2024 13:57
My Darktable Workflow

My Darktable Workflow

Basic workflow

  • Copy a film roll (a directory of RAW images) into a directory on the machine running Darktable.
  • Import the film roll into Darktable.
  • Review the images using lighttable mode and remove any images that are beyond repair.
  • Take a snapshot of the image so we can do a before and after comparison.
  • Adjust the white balance.
  • Exposure compensation and recovery.