Skip to content

Instantly share code, notes, and snippets.

@bfoz
bfoz / fixup_committer_date.sh
Created September 7, 2010 19:24
Force GIT_COMMITTER_DATE = GIT_AUTHOR_DATE
git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"'
@OnesimusUnbound
OnesimusUnbound / quote.txt
Last active August 16, 2023 16:24
Programming Quotes
[T]he difference between a bad programmer and a
good one is whether he considers his code or his
data structures more important. Bad programmers
worry about the code. Good programmers worry about
data structures and their relationships.
-- Linus Torvalds
~~~
Clarity and brevity sometimes are at odds.
When they are, I choose clarity.
-- Jacob Kaplan-Moss
@rodneyrehm
rodneyrehm / anti-keygrabber.user.js
Last active May 26, 2024 17:50
GreaseMonkey: Prevent Web Applications From Grabbing Certain HotKeys
// ==UserScript==
// @name anti key-grabber
// @description Prevent web apps from capturing and muting vital keyboard shortcuts
// @grant none
// @version 1.1
// ==/UserScript==
(function(){
var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x");
unsafeWindow.document.addEventListener('keydown', function(e) {
if (e.keyCode === 116) {
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@huyhong
huyhong / .slate
Last active December 24, 2015 22:39
.slate config for https://github.com/jigish/slate, replaces Divvy for me
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config orderScreensLeftToRight false
default color resolutions:1920x1200;1200x1920;1200x1920
# Old Divvy Setup
# bind 1:ctrl;cmd move 0;0 screenSizeX/1.75;screenSizeY
# bind 2:ctrl;cmd move (screenSizeX-(screenSizeX/1.75));0 screenSizeX/1.75;screenSizeY
@werkshy
werkshy / cr
Created October 22, 2013 18:49
Asana code review CLI
#!/usr/bin/env ruby
# cr: send an Asana ticket for code review
# It will add (or re-open) a sub-task called 'Code Review' owned
# by the specified user.
# Usage:
# cr [-a ASANA_ID] [-g GIT_COMMIT] username
#
# - If the Asana ticket ID is given, use that.
@tallus
tallus / IndieTumblrTheme
Last active May 28, 2023 10:49
An IndieWebify-ied Tumblr Theme
<!doctype html>
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en" class="no-js"> <!--<![endif]-->
<head>
<!-- Meta tags -->

Setup

1. Run software update

Make sure everything is up to date.

2. Install Xcode and/or "Command Line Tools"

"Command Line Tools" can be downloaded separate from Xcode at

@peterwilsoncc
peterwilsoncc / micropubfilter.php
Created February 11, 2015 02:50
Include trashed posts in url_to_postid
<?php
function micropub_url_to_postid($url) {
global $wp_rewrite;
/**
* Filter the URL to derive the post ID from.
*
* @since 2.2.0
*
@aaronpk
aaronpk / ruby-setup.txt
Last active August 29, 2015 14:25
setting up Ruby on a new OSX computer
brew install ruby-install
ruby-install ruby 2.1.6
gem install bundler
brew install libxml2 libxslt # usually required for some ruby libraries
brew install chruby
# this sets the paths for ruby and bundle to the newly installed ruby
chruby 2.1.6
# now you can install other rubies:
ruby-install ruby 2.2.2