Skip to content

Instantly share code, notes, and snippets.

View rynop's full-sized avatar

Ryan Pendergast rynop

View GitHub Profile
@rynop
rynop / datatables_software_version_sort.js
Created June 25, 2014 15:29
Datatables software version sort plugin
/**
* Compares two software version numbers (e.g. "1.7.1" or "1.2b").
*
* This function was born in http://stackoverflow.com/a/6832721.
*
* @param {string} v1 The first version to be compared.
* @param {string} v2 The second version to be compared.
* @param {object} [options] Optional flags that affect comparison behavior:
* <ul>
* <li>
<p>I use Blah and blah</p>
<p><markdown>
### config.php: ###
#!javascript
function test()
{
return "aaa";
}
@rynop
rynop / asset_patch.diff
Created December 10, 2010 15:30
patch for breaking up js,css,codeblock when debug > 0
86,89c86,104
< }
<
< if (Configure::read('debug') && $this->options['debug'] == false) {
< return join("\n\t", $this->View->__scripts);
---
> }
>
> //Allow breaking up of js,css,codeblock in your html when debug is > 0
> //Ex: putting 'css' in head and 'js','codeblock' at bottom before </body>
@rynop
rynop / url_cache_test_patch.diff
Created December 10, 2010 19:19
fixing test case
23,24c23,24
< $this->assertEqual($url, '/posts/');
< $this->assertEqual(array('c0662a9d1c026334679f7a02e6c0f8e0' => '/posts/'), $this->HtmlHelper->_cache);
---
> $this->assertEqual($url, '/posts');
> $this->assertEqual(array('c0662a9d1c026334679f7a02e6c0f8e012a55d605aac76775a2f56efac64438a' => '/posts'), $this->HtmlHelper->_cache);
28c28
< $this->assertEqual(array('c0662a9d1c026334679f7a02e6c0f8e0' => '/posts/'), $cache);
---
> $this->assertEqual(array('c0662a9d1c026334679f7a02e6c0f8e012a55d605aac76775a2f56efac64438a' => '/posts'), $cache);
@rynop
rynop / url_cache_patch.diff
Created December 10, 2010 19:20
add FormHelper support to url_cache
32,33c32,39
< $this->_key = 'url_map' . $this->_key;
< $this->_cache = Cache::read($this->_key, '_cake_core_');
---
> if (is_a($this, 'HtmlHelper')) {
> $this->_key = 'url_map_html' . $this->_key;
> $this->_cache = Cache::read($this->_key, '_cake_core_');
> }
> elseif (is_a($this, 'FormHelper')){
> $this->_key = 'url_map_form' . $this->_key;
/etc/nginx# cat fastcgi_params
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
@rynop
rynop / caplog.txt
Created December 28, 2010 14:26
Failing cap
* executing "ls -xt /opt/doapp/adagogo/prod/webapp/releases"
servers: ["XXX.compute-1.internal"]
D, [2010-12-28T03:43:11.464864 #3278] DEBUG -- net.ssh.transport.session[3fdec15e3870]: establishing connection to XXX.compute-1.internal:22
D, [2010-12-28T03:43:11.467686 #3278] DEBUG -- net.ssh.transport.session[3fdec15e3870]: connection established
I, [2010-12-28T03:43:11.467818 #3278] INFO -- net.ssh.transport.server_version[3fdec15e31cc]: negotiating protocol version
D, [2010-12-28T03:43:11.475367 #3278] DEBUG -- net.ssh.transport.server_version[3fdec15e31cc]: remote is `SSH-2.0-OpenSSH_5.5p1 Debian-4ubuntu4'
D, [2010-12-28T03:43:11.475440 #3278] DEBUG -- net.ssh.transport.server_version[3fdec15e31cc]: local is `SSH-2.0-Ruby/Net::SSH_2.0.15 x86_64-linux'
D, [2010-12-28T03:43:11.477067 #3278] DEBUG -- tcpsocket[3fdec15e34c4]: read 784 bytes
D, [2010-12-28T03:43:11.477252 #3278] DEBUG -- tcpsocket[3fdec15e34c4]: received packet nr 0 type 20 len 780
I, [2010-12-28T03:43:11.477360 #3278] INFO -- net.ssh.t
set :application, "XXX"
role :app, "XXX.compute-1.internal", :primary => true
role :app, "XXX.compute-1.internal"
ssh_options[:keys] = "#{ENV['HOME']}/.ssh/dasdeploy_rsa"
ssh_options[:verbose] = :debug
ssh_options[:auth_methods] = "publickey"
ssh_options[:forward_agent] = true
ssh_options[:config]=false
@rynop
rynop / qtip2
Created January 18, 2011 22:30
$('a.addTarget').each(function(){
$(this).qtip(
{
content: {
text: $("#ctoPop")
},
position: {
my: 'left top',
at: 'right top',
adjust: { screen: true }
<?php
debug('wtf');
/**
* Application level View Helper
*
* This file is application-wide helper file. You can put all
* application-wide helper-related methods here.
*
* PHP versions 4 and 5
*