Skip to content

Instantly share code, notes, and snippets.

View dharFr's full-sized avatar

Olivier Audard dharFr

View GitHub Profile
@dharFr
dharFr / keybase.md
Last active August 29, 2015 14:22
keybase.md

Keybase proof

I hereby claim:

  • I am dharfr on github.
  • I am oad (https://keybase.io/oad) on keybase.
  • I have a public key whose fingerprint is 562F CA1A 515F D1B7 D0B8 2EA9 9967 66E6 24A9 4F77

To claim this, I am signing this object:

@dharFr
dharFr / jquery.unserialize-0.2.js
Created June 6, 2011 10:22 — forked from rcmachado/jquery.unserialize.js
$.unserialize [updated] for jQuery
/**
* $.unserialize
*
* Takes a string in format "param1=value1&param2=value2" and returns an object { param1: 'value1', param2: 'value2' }.
* If the "param1" ends with "[]" the param is treated as an array.
*
* Parses the value as String, Int or Boolean
* @todo: parseFloat could also be useful I guess.
*
* Example:
@dharFr
dharFr / upload-form.html
Created July 23, 2011 14:10
Asynschronous HTML File Upload (fake Ajax)
<script language="javascript" type="text/javascript">
function formUploadCallback (result) {
console.log("Upload OK:", result);
alert('Upload OK');
}
</script>
<form target="upload_target" action="upload.php" enctype="multipart/form-data" method="post">
File: <input name="myfile" type="file" />
<input name="submitBtn" type="submit" value="Submit" />
</form>
@dharFr
dharFr / jquery.helpbox.js
Created July 23, 2011 14:24
Simple jQuery plugin used to display contextual help
/**
* jQuery helpBox plugin v0.1
* ==========================
*
* http://www.dhar.fr
*
* Provides a simple way to add contextual help in your page.
* @author Olivier Audard - audard[AT]gmail[DOT]com
*
* Usage:
@dharFr
dharFr / extractURLParams.coffee
Created January 13, 2012 14:36
Simple CoffeeScript function to extracts parameters from URL
utils = utils || {}
utils.extractURLParams =->
params = window.location.search.substring(1).split "&"
result = {}
for param in params
strParam = param.toString()
sepPos = strParam.indexOf "="
key = strParam.substring 0, sepPos
@dharFr
dharFr / svn-rm-deleted.sh
Created February 20, 2012 17:17
Svn: how to remove all deleted files from repository?
# for more details, see: http://stackoverflow.com/questions/4608798/svn-how-to-remove-all-deleted-files-from-repository
svn st | grep '^!' | awk '{print $2}' | xargs svn delete --force
@dharFr
dharFr / jquery.queue.coffee
Created March 29, 2012 23:39
jQuery plugin used to queue $.Deferred's Promise objects
###*
* jQuery queue plugin v0.1
* ==========================
*
* Used to queue $.Deferred's Promise objects
* author @_dhar
###
(($) ->
@dharFr
dharFr / readme.md
Created April 5, 2012 13:59
Grails run-app Helper

Grails run-app Helper

Launch 'grails run-app' with options:

-v | --grails-version  Specify grails version
-r | --remote-host     Run 'grails run-app' with -Dserver.host={your-ip} option
-p | --port            Run 'grails run-app' with -Dserver.port={value}
-h | --help            Display help

Setup

@dharFr
dharFr / spock-whenthen.sublime-snippet
Created July 5, 2012 15:19
Sublime Text 2 snippet for basic 'when/then' Grails Spock test
<snippet>
<content><![CDATA[
def "${1:name your test}"() {
setup:
// setup your test
def l = [1, 2, 3]
when:
// test something
def r = l.findAll {it > 2}
then:
@dharFr
dharFr / Sample output
Created August 23, 2012 16:05
grailsenv - Dynamically switch your GRAILS_HOME
oaudard@work:~/Projects/sample-grails-project$ grailsenv
GRAILS_HOME=/home/oaudard/dev-utils/grails
grails
grails-1.3.7
grails-1.3.8
grails-2.0.0
grails-2.0.1
grails-2.0.3
grails-2.0.4
grails-2.1.0