Skip to content

Instantly share code, notes, and snippets.

@scrooloose
scrooloose / gist-line-number-hack.js
Created June 27, 2010 08:59
A hack to add line numbers to gists, requires jquery
function addLineNumbersToAllGists() {
$('.gist').each( function() {
_addLineNumbersToGist('#' + $(this).attr('id'));
});
}
function addLineNumbersToGist(id) {
_addLineNumbersToGist('#gist-' + id);
}
// BlackBerry Geolocation. Tested w/ 4.6.0.297.
// http://docs.blackberry.com/en/developers/deliverables/1143/browser_devguide.pdf
if (window.blackberry && blackberry.location && blackberry.location.GPSSupported) {
var AUTONOMOUS_AID_MODE = 2;
function win() {
clearTimeout(failTimeoutId);
blackberry.location.removeLocationUpdate(win);
alert(blackberry.location.latitude + " : " + blackberry.location.longitude);
}
@acreeger
acreeger / ExternalInPlacePlugin_BuildConfig.groovy
Created April 8, 2011 18:33
Code that you can add to your app's BuildConfig to enable you to specify in-place plugins outside of source controlled files
def buildConfigFile = new File("${userHome}/.grails/${appName}-buildConfig.groovy")
if (buildConfigFile.exists()) {
println "Processing external build config at $buildConfigFile"
def slurpedBuildConfig = new ConfigSlurper().parse(buildConfigFile.toURL())
slurpedBuildConfig.grails.plugin.location.each { k, v ->
if (!new File(v).exists()) {
println "WARNING: Cannot load in-place plugin from ${v} as that directory does not exist."
} else {
println "Loading in-place plugin $k from $v"
grails.plugin.location."$k" = v
@rbramley
rbramley / CreateSonarPom.groovy
Created July 29, 2011 21:46
A Grails Gant script to create a Maven POM for the Sonar Groovy Plugin
/*
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@uarun
uarun / filetype.vim
Created August 3, 2011 19:32
Gradle syntax highlighting in vim
# ~/.vim/filetype.vim
au BufNewFile,BufRead *.gradle setf groovy
@olivierlacan
olivierlacan / launch_sublime_from_terminal.markdown
Created September 5, 2011 15:50
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@letmaik
letmaik / .travis.yml
Last active December 15, 2021 23:10
Deploy snapshots to Sonatype after Travis CI build
language: java
env:
global:
- SONATYPE_USERNAME=yourusername
- secure: "your encrypted SONATYPE_PASSWORD=pass"
after_success:
- python addServer.py
- mvn clean deploy --settings ~/.m2/mySettings.xml
@jpawlowski
jpawlowski / brew-sync.sh
Last active September 26, 2023 19:54
Sync Homebrew installations between Macs via Dropbox
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
@jlongster
jlongster / cloth-lljs.js
Last active December 16, 2015 03:29
large LLJS example
extern clear, fillRect, renderLine, print;
struct Vec2d {
function void Vec2d(float x, float y) {
this->x = x;
this->y = y;
}
float x;