Skip to content

Instantly share code, notes, and snippets.

View cjsimon's full-sized avatar

Christopher Simon cjsimon

View GitHub Profile
@robbyrussell
robbyrussell / better-favicon-for-google.js
Created January 12, 2009 22:15
Greasemonkey script to change the favicon for Google to a old and improved (and less colorful one)
// ==UserScript==
// @name BetterFavicon
// @namespace planetargon
// @description A better favicon for google
// @include http://*.google.com/
// ==/UserScript==
var favicon_link_html = document.createElement('link');
favicon_link_html.rel = 'icon';
favicon_link_html.href = 'http://robbyonrails.com/files/google-favicon.ico';
@benbahrenburg
benbahrenburg / gist:1129364
Created August 6, 2011 14:15
Tell git to globally ignore .DS_Store
git config --global core.excludesfile ~/.gitignore
echo .DS_Store >> ~/.gitignore
@matthewmccullough
matthewmccullough / git-compressing-and-deltas.md
Created May 14, 2012 19:05
Git, Compression, and Deltas - An explanation

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo:

@Mins
Mins / mysql_secure.sh
Last active May 31, 2024 14:19
Automating mysql_secure_installation
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10
@james2doyle
james2doyle / NodeWebkit.sublime-build
Created January 31, 2013 16:44
Sublime Text 2 build system for Node Webkit
{
"cmd": ["node-webkit", "${project_path:${folder}}"],
"working_dir": "${project_path:${folder}}",
"path": "/Applications/node-webkit.app/Contents/MacOS/"
}
@brandonmwest
brandonmwest / example.cs
Last active June 27, 2024 04:03
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));
@alexpchin
alexpchin / Setting_upa_new_repo.md
Last active June 24, 2024 10:59
Create a new repository on the command line

Setting up a new Git Repo

##Create a new repository on the command line

touch README.md
git init
git add README.md
git commit -m "first commit"

git remote add origin git@github.com:alexpchin/.git

@staltz
staltz / introrx.md
Last active June 29, 2024 15:58
The introduction to Reactive Programming you've been missing
@jordan-brough
jordan-brough / git-recent
Last active June 27, 2024 21:22
Git: Display a list of recently checked out branches/tags/commits
#!/usr/bin/env bash
# Source: https://gist.github.com/jordan-brough/48e2803c0ffa6dc2e0bd
# See also: https://stackoverflow.com/a/25095062/58876
# Download this script as "git-recent" (no extension), chmod it to be executable and put it in your
# path somewhere (e.g. /usr/bin). You can then use it via `git recent` from inside any git repo.
# Examples:
@nurinamu
nurinamu / tag_img.rb
Created September 7, 2014 23:13
jekyll plugin for custom size img tag.
module Jekyll
class RenderImgTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@url , *@val= text.split(/ /)
if @val.length > 0
@width , *@height = @val[0].split(/x/)
end