Skip to content

Instantly share code, notes, and snippets.

View jubstuff's full-sized avatar

Giustino Borzacchiello jubstuff

View GitHub Profile
$.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
var data = originalOptions.data;
if( data && data.action === 'ab_session_save' && data.time_from) {
options.data = $.param($.extend(originalOptions.data||{}, {
make: $('#'+$options.makeId).find("option:selected").text(),
model: $('#'+$options.modelId).find("option:selected").text(),
version: $('#'+$options.versionId).find("option:selected").text()
}));
}
@jubstuff
jubstuff / 0_reuse_code.js
Created April 1, 2014 08:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jubstuff
jubstuff / gist:a5aa601d95b4f295d440
Created October 13, 2014 14:25
List all commit messages from a tag to HEAD
git log --oneline $(git rev-list $TAG | head -n 1)..HEAD | sed '/Merge remote-tracking/d'
@jubstuff
jubstuff / .htaccess
Last active August 29, 2015 14:08
wp-cli.yaml for single wordpress install
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
@jubstuff
jubstuff / createuser
Created December 22, 2014 18:54
Create user in Mysql
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
@jubstuff
jubstuff / gist:e39e1446b13be872edf2
Created February 25, 2015 15:47
Skip confirmation on git clone from Bitbucket
echo -e "Host bitbucket.org\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
@jubstuff
jubstuff / FilterStorage.php
Last active August 29, 2015 14:19
Filter Storage
<?php
/**
* Stores a value and calls any existing function with this value.
*/
class FilterStorage
{
/**
* Filled by __construct(). Used by __call().
*
* @type mixed Any type you need.
@jubstuff
jubstuff / bridge-DOM.js
Last active August 29, 2015 14:22
Simple Toggle widget with jQuery or Backbone
var toggleFacet = {
init: function (options, elem) {
this.options = $.extend({}, this.options, options);
this.$elem = $(elem);
this.eventify();
},
options: {
toggleClass: 'facet-collapsed'
@jubstuff
jubstuff / index.html
Last active August 29, 2015 14:26
MarionetteJS Example - Static View
<div id="main-region">
<p>This is static</p>
</div>
<script type="text/template" id="static-template">
<p> This is a text rendered by our Marionette App. </p>
</script>
@jubstuff
jubstuff / hello_world.rb
Created September 1, 2011 08:08
Simple Hello World
def hello
puts "hello"
end