Skip to content

Instantly share code, notes, and snippets.

@jbafford
jbafford / gist:d91ac15cf79a22e70f65
Created August 4, 2014 21:03
List OSX codesign versions for installed apps
find /Applications ~/Applications -maxdepth 3 -name "*.app" | while read a ; do echo; echo -n "$a ___ "; codesign -vd "${a}" 2>&1 | awk '/version/ {print $3}'; done | awk -F'___' '{print $2 " " $1}' | sort -u
@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' *
@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,
@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
@edenwaith
edenwaith / git-branch-batch-rename
Created February 9, 2015 17:27
Rename multiple git branches from the command line
git branch | grep defects | awk '{original=$1; sub("defects","old-defects"); print original, $1}' | xargs -n 2 git branch -m
@tehlers
tehlers / gradle.sh
Created May 27, 2015 07:42
This script will execute the Gradle wrapper, if it is available in the current or a parent directory. Otherwise it will fall back to start the Gradle version found in $PATH. The intended way to use this script is as an alias for 'gradle'.
#! /usr/bin/env bash
#
# This script will execute the Gradle wrapper, if it is available in the current
# or a parent directory. Otherwise it will fall back to start the Gradle version
# found in $PATH.
#
# The intended way to use this script is as an alias for 'gradle'.
#
@arnekolja
arnekolja / MyController.php
Created January 10, 2015 19:05
TYPO3, Extbase: Simple JsonView usage
<?php
/* This is tested with 6.2.9 only */
namespace MY\Extension\Controller;
class MyController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
private $ajaxPageType = 133799;
/**