Skip to content

Instantly share code, notes, and snippets.

Thomas Stachl tstachl

Block or report user

Report or block tstachl

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
@tstachl
tstachl / mootools.cloneEventsDeep.js
Created Oct 7, 2010
Teach mootools to clone events of children too.
View mootools.cloneEventsDeep.js
Native.implement([Element, Window, Document], {
cloneEventsDeep: function(from, type){
if (this.getChildren().length > 0) {
this.getChildren().each(function(item, index) {
item.cloneEventsDeep(from.getChildren()[index], type);
});
this.cloneEvents(from, type);
} else {
this.cloneEvents(from, type);
}
@tstachl
tstachl / mootools.isNumeric.js
Created Oct 7, 2010
Mootools extension, check string is numeric.
View mootools.isNumeric.js
String.implement({
isNumeric: function() {
var r = true;
this.split('').each(function(i) {
if ('0123456789.,'.indexOf(i) == -1) {
r = false;
}
});
return r;
}
@tstachl
tstachl / Imap.php
Created Nov 9, 2010
Zend_Auth_Adapter to authenticate via IMAP
View Imap.php
<?php
/**
* Stachl
*
* LICENSE
*
* This source file is subject to the CC-GNU GPL license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://creativecommons.org/licenses/GPL/2.0/
@tstachl
tstachl / Config.php
Created Nov 9, 2010
Zend_Controller_Action_Helper to allow direct access to xml and ini configs saved in APPLICATION_PATH /configs
View Config.php
<?php
/**
* Stachl
*
* LICENSE
*
* This source file is subject to the CC-GNU GPL license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://creativecommons.org/licenses/GPL/2.0/
@tstachl
tstachl / Ping.php
Created Nov 9, 2010
Stachl_Ping is a class to ping hosts and get min, avg, max and standard deviation of rountrips
View Ping.php
<?php
/**
* Stachl
*
* LICENSE
*
* This source file is subject to the CC-GNU GPL license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://creativecommons.org/licenses/GPL/2.0/
@tstachl
tstachl / replace.py
Created Mar 12, 2011
Search and replace a string in a file as a python one-liner
View replace.py
"""
Search and replace a string in a file as a python one-liner
@author Thomas Stachl
@created Mar 12, 2011
@license Attribution 3.0 Unported (CC BY 3.0)
This work is licensed under the Creative Commons Attribution 3.0
Unported License. To view a copy of this license, visit
http://creativecommons.org/licenses/by/3.0/ or send a letter to
@tstachl
tstachl / InheritConfigParser.py
Created Mar 28, 2011
A python configparser extension where sections can inherit from previous defined sections.
View InheritConfigParser.py
"""
Stachl
LICENSE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@tstachl
tstachl / ProxyRb.rb
Created Nov 19, 2011
Sinatra Ruby Javascript Ajax Request Proxy
View ProxyRb.rb
# Copyright (c) 2012, Thomas Stachl <thomas@stachl.me>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
@tstachl
tstachl / gist:2760221
Created May 21, 2012
Salesforce open Simple Dialog in custom button/link or on a visualforce page
View gist:2760221
// if you want to use it inside a visualforce page create a function around it
function showFollowUp() {
// if you want to use it in a button make sure you require jQuery
// {!REQUIRESCRIPT("https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js")} // UNCOMMENT IF IN A BUTTON
// get the dialog with your dialog name
var d = sfdcPage.dialogs['MyCoolDialog'], close;
if (!d) {
// if the dialog doesn't exist create one
d = sfdcPage.dialogs['MyCoolDialog'] = new SimpleDialog('MyCoolDialog', false);
// set general information on your dialog and finally run the create function
@tstachl
tstachl / gist:2888905
Created Jun 7, 2012
Desk.com Salesforce integration. This snippet shows you how to create a autocomplete field on the contacts template containing all your contacts of your Salesforce organization.
View gist:2888905
<div class="agent_customer_gravatar">
<span class="a-user-icon">
{{thumb}} {{social_profile}}
</span>
</div>
<div class="agent_customer_section short" >
{{first_name}}
</div>
You can’t perform that action at this time.