Skip to content

Instantly share code, notes, and snippets.

Olivier Audard dharFr

Block or report user

Report or block dharFr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dharFr
dharFr / keybase.md
Last active Aug 29, 2015
keybase.md
View 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 Jun 6, 2011 — forked from rcmachado/jquery.unserialize.js
$.unserialize [updated] for jQuery
View jquery.unserialize-0.2.js
/**
* $.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 Jul 23, 2011
Asynschronous HTML File Upload (fake Ajax)
View upload-form.html
<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 Jul 23, 2011
Simple jQuery plugin used to display contextual help
View jquery.helpbox.js
/**
* 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 / jquery.pinger-0.2.js
Created Jul 26, 2011
$.pinger : jQuery plugin for ping-URL process
View jquery.pinger-0.2.js
/**
* $.pinger
*
* If your page runs into an iframe hosted by another domain, you may want to keep the session open.
* This plugin automates the "ping URL" process and provides some options.
*
* The pinger will ask the given URL every 'interval' minutes if it detects
* some activity by listening to the events listed in 'listen' parameter.
*
* Have a look to the 'defaults' variable below for further details about available parameters and default values.
@dharFr
dharFr / extractURLParams.coffee
Created Jan 13, 2012
Simple CoffeeScript function to extracts parameters from URL
View extractURLParams.coffee
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 Feb 20, 2012
Svn: how to remove all deleted files from repository?
View svn-rm-deleted.sh
# 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 Mar 29, 2012
jQuery plugin used to queue $.Deferred's Promise objects
View jquery.queue.coffee
###*
* jQuery queue plugin v0.1
* ==========================
*
* Used to queue $.Deferred's Promise objects
* author @_dhar
###
(($) ->
@dharFr
dharFr / readme.md
Created Apr 5, 2012
Grails run-app Helper
View readme.md

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 Jul 5, 2012
Sublime Text 2 snippet for basic 'when/then' Grails Spock test
View spock-whenthen.sublime-snippet
<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:
You can’t perform that action at this time.