Skip to content

Instantly share code, notes, and snippets.

View appden's full-sized avatar

Scott Kyle appden

View GitHub Profile
// a suggestion to Objective-J for better performance
var HTMLEntities = {
'&': '&',
'"': '"',
"'": ''',
'<': '&lt;',
'>': '&gt;'
};
Class.Mutators.jQuery = function(name){
var self = this;
jQuery.fn[name] = function(arg){
var instance = this.data(name);
if ($type(arg) == 'string'){
var prop = instance[arg];
if ($type(prop) == 'function'){
var returns = prop.apply(instance, Array.slice(arguments, 1));
return (returns == instance) ? this : returns;
} else if (arguments.length == 1){
// fun experiment :-)
Element.implement('wait', function(duration){
var el = this, stack = [];
stack.each.delay(duration || 500, stack, function(info){
el = el[info.name].apply(el, info.args);
});
return Object.map(Element.prototype, function(method, name){
@appden
appden / reload.bash
Created March 27, 2011 18:27
Reload your bash profile in all open bash instances
# put this in your bash profile (change the line below if you use .bash_profile)
# refresh profile on USR1 signal
trap 'eval $(PATH= /usr/libexec/path_helper -s) && source ~/.profile' USR1
# send USR1 signal to all bash instances
reload() {
ps -xo pid,command | grep ' \-bash' | awk '{print $1}' | while read pid; do
kill -USR1 $pid
done
@appden
appden / pronto2broadlink.py
Last active July 16, 2023 18:43
Convert Pronto IR hex codes to LIRC pulses then Broadlink packets compatible with python-broadlink