Skip to content

Instantly share code, notes, and snippets.

@blech
blech / README.md
Last active September 24, 2015 10:38
iTunes defaults

These four defaults settings will disable Ping, hide the dropdown, restore the old arrows, and invert them such that clicking them will navigate the libary, not the Store. Boiled down from http://gidden.net/tom/2010/09/25/removing-ping

defaults write com.apple.iTunes disablePingSidebar 1
defaults write com.apple.iTunes hide-ping-dropdown 1
defaults write com.apple.iTunes show-store-link-arrows 1

defaults write com.apple.iTunes invertStoreLinks 1

@blech
blech / README.md
Last active September 24, 2015 12:18
Recreate Delicious network on Pinboard

This is a naive attempt to map Delicious users to those on Pinboard. It's probably not much use to anyone now but it did a good enough job for me, back when I wrote it.

@nichtich
nichtich / pica2json.pl
Created January 17, 2011 22:49
Wandelt PICA+ (egal welche Form) nach JSON (ohne Subfield-Ordnung)
#!/usr/bin/perl
use strict;
use warnings;
=head1 NAME
pica2json - Wandelt PICA+ (egal welche Form) nach JSON (ohne Subfield-Ordnung)
=cut
@ssp
ssp / ExifTool commands
Created January 27, 2011 19:50
exiftool commands
# Move Description tag to Title tag
exiftool '-Description>Title' *
# Move Title tag to Headline Tag
exiftool '-Title>Headline' *
# Rename from tag, adding number if necessary for uniqueness,
# without changing file dates.
exiftool '-FileName<${description}%-c.jpeg' '-DateTimeOriginal>FileModifyDate' *
@MetroWind
MetroWind / zalgo.py
Last active January 19, 2021 19:15
My take on a Zalgo text generator. Read from stdin. See "zalgo.py --help".
#!/usr/bin/env python3
# For Python 3
######################################################################
################### Read from stdin and Zalgo-ify ####################
############# By MetroWind <chris.corsair {AT} gmail> ################
######################################################################
import sys, os
@ssp
ssp / git-extract-file.markdown
Created January 23, 2012 13:21
Extract a single file from a git repository

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch

@mikeabdullah
mikeabdullah / gist:3116322
Created July 15, 2012 11:18
Safely wrapping keychain passwords with NSString/CFString
void freeKeychainContent(void *ptr, void *info)
{
SecKeychainItemFreeContent(NULL, ptr);
}
- (NSString *)passwordFromKeychainItem:(SecKeychainItemRef)keychainItem
{
void *passwordData;
UInt32 passwordLength;
OSStatus status = SecKeychainItemCopyContent(keychainItem,
@mbostock
mbostock / .block
Last active March 1, 2024 06:07
The Gist to Clone All Gists
license: gpl-3.0
@ssp
ssp / xmlpassthrough.xsl
Last active December 12, 2015 05:39
XSLT hack for Solr results to pass the content of a specific field through unchanged. Allows for structured XML content in Solr results.
<?xml version='1.0' encoding='UTF-8'?>
<!--
XSL hack for retrieving structured XML data from Solr fields without re-parsing.
It assumes that the <str> field »xml« contains valid XML, replaces the
<str> tag by an <xml> tag and includes the field content without escaping.
To use this, place the XSL in the »conf/xslt« folder
and invoke the XSLT Response writer [1] for this XSL by appending
&wt=xslt&tr=xmlpassthrough.xsl
@bkeepers
bkeepers / .gitconfig
Created February 19, 2013 14:12
Git aliases to make new commits that fixup or are squashed into previous commits
[alias]
fixup = !sh -c 'REV=$(git rev-parse $1) && git commit --fixup $@ && git rebase -i --autosquash $REV^' -
squash = !sh -c 'REV=$(git rev-parse $1) && git commit --squash $@ && git rebase -i --autosquash $REV^' -