Skip to content

Instantly share code, notes, and snippets.

View seanf's full-sized avatar

Sean Flanigan seanf

  • Brisbane, Australia
View GitHub Profile
@silb
silb / NativeDomEvents.java
Created January 27, 2011 10:53
For registering Java runnables as event listeners on GWT DOM elements
/**
* For registering Java {@link Runnable runnables} as event listeners on GWT DOM elements.
* <p>
* This class allows for registering listeners for all DOM events including those not supported by GWT.
*/
public class NativeDomEvents {
public static native void addEventListener(Element element, String event, Runnable listener) /*-{
var eventListener = function() {
@jessedearing
jessedearing / cleanup.sh
Created April 12, 2012 17:48 — forked from mdp/cleanup.sh
Git branch cleanup
#!/bin/bash
# This must be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
git branch --merged master | grep -v 'master$' | xargs git branch -d
# Show remote fully merged branches
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active November 14, 2024 09:13
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@imankulov
imankulov / android2po_plurals.py
Created December 17, 2012 14:54
Get gettext formatted plural forms from CLDR description using android2po (to do the main job) and opterator (for command line parsing)
#!/usr/bin/env python
"""
Requirements:
android2po
opterator
Sample:
$ python android2po_plurals.py pl
@payload
payload / prettyics.sh
Created May 31, 2013 21:01
pretty print a .ics calendar file
#!/bin/sh
perl -ne'/END:/ && $i--; print "\t" x $i . "$_\n"; /BEGIN:/ && $i++;'
@akiomik
akiomik / .gitattributes
Created December 19, 2013 15:30
gitattributes for scala
*.scala diff=scala
@kdabir
kdabir / README.md
Last active August 29, 2015 13:56
This script pulls your starred repos on github and shows some interesting stats at the end. It was created as an example demonstrating how Gstorm is useful in scripts.

This script is created as an example to show how easy it is to use gstorm to crunch and consume data from rest apis.

Usage

Either download the script and run:

groovy ghstarred.groovy <your_github_id>

Or hotload it:

@P7h
P7h / jdk_download.sh
Last active July 31, 2024 06:46
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@nicktoumpelis
nicktoumpelis / git-make-empty-root.sh
Last active July 3, 2024 18:28
Create an empty initial commit
git checkout --orphan temp_master
git rm -rf .
git commit --allow-empty -m 'Make initial root commit'
git rebase --onto temp_master --root master
git branch -D temp_master
@fappel
fappel / Repeat.java
Last active June 5, 2023 16:58
JUnit 4 TestRule to run a test repeatedly for a specified amount of repititions
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention( RetentionPolicy.RUNTIME )
@Target( {
java.lang.annotation.ElementType.METHOD
} )
public @interface Repeat {
public abstract int times();