Skip to content

Instantly share code, notes, and snippets.

@robolson
robolson / update-gits.sh
Created March 7, 2009 21:39
Shell script to check multiple git repositories for updates.
#!/bin/bash
repos=(
"/Users/rob/Library/Application Support/TextMate/Bundles/Git.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/Ruby.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/RubyAMP.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/Ruby Haml.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/ruby-sass.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/ruby-shoulda.tmbundle"
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
@jonnywray
jonnywray / FutureUpdateBehavior.java
Last active September 3, 2021 15:16
Wicket FutureUpdateBehavior: allows asynchronous update of components.
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.util.time.Duration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
@meltingice
meltingice / usernode.php
Created November 15, 2010 03:15
Social graph functions implemented using Redis.
<?
/*
* This example would probably work best if you're using
* an MVC framework, but it can be used standalone as well.
*
* This example also assumes you are using Predis, the excellent
* PHP Redis library available here:
* https://github.com/nrk/predis
*/
<?php
private function registerTemplatingConfiguration(array $config, $ide, ContainerBuilder $container, XmlFileLoader $loader)
{
$loader->load('templating.xml');
$loader->load('templating_php.xml');
$links = array(
'textmate' => 'txmt://open?url=file://%f&line=%l',
'macvim' => 'mvim://open?url=file://%f&line=%l',
@uncreative
uncreative / OpenInEclipse.applescript
Created July 22, 2011 19:23
externally open a specific file in eclipse, and go to some line
(*
-------- WHAT THIS DOES --------
Enables you to externally open a specific file in eclipse, and go to some line
that is, makes a link with href of
openineclipse://open?url=file:///absolute/path/tofile.ext&line=5
open absolute/path/tofile.ext in eclipse
and go to line 5
@defunkt
defunkt / gitio
Created September 11, 2011 08:11
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@tanakahisateru
tanakahisateru / gist:1344162
Created November 7, 2011 04:18
PHP5.4 configure with MacPorts besides existing PHP
./configure \
--prefix=/opt/local/php/5.4 \
--bindir=/opt/local/bin \
--with-config-file-path=/opt/local/php/5.4/etc \
--with-config-file-scan-dir=/opt/local/php/5.4/var/db \
--mandir=/opt/local/php/5.4/share/man \
--infodir=/opt/local/php/5.4/share/info \
--program-suffix=-5.4 \
--with-apxs2=/opt/local/apache2/bin/apxs \
--enable-pdo \
@barraponto
barraponto / git-submodule-rm.sh
Created April 25, 2012 16:36
git submodule-rm
#!/bin/bash
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}
@leon
leon / TruncateHtmlExtension.php
Created June 2, 2012 11:25
Symfony 2 Twig Extension that truncates html and preserves tags
<?php
/**
Truncate Html string without stripping tags
register in Resources/config/services.yml with:
services:
truncatehtml.twig.extension:
class: Radley\TwigExtensionBundle\Extension\TruncateHtmlExtension
tags:
- { name: twig.extension }