Skip to content

Instantly share code, notes, and snippets.

@nini
nini / ums_w_attachment.php
Created December 12, 2014 13:54
Experian UMS send with attachment
<?php
/**
* Script to send an email using Experian UMS with attachments
*/
$url = 'http://sysmail.fagms.net/c/tm?ACTION=SYSTEM';
$file = 'test.png';
$aid = 000000; // Replace with your ID
$email = '...'; // Replace with your email
file_put_contents($file, base64_decode(test_png()));
@nini
nini / gist:dc001d2973f75b332f6e
Created June 15, 2015 10:05
jQuery delays + queue for autoclose example
button = $('button');
if(button.hasClass('close')) {
button.delay(1000).queue(function() {
$(this).click().dequeue();
});
}
@nini
nini / gist:66741094729b7b848bed
Created June 15, 2015 10:18
jQuery promise after animation
$( ".elem" ).each(function( i ) {
$( this ).fadeIn().fadeOut( 1000 * ( i + 1 ) );
});
$( ".elem" ).promise().done(function() {
$( "p" ).append( " Finished! " );
});
@nini
nini / gist:310cf73241d01bb3b1f3
Created June 17, 2015 12:01
Puppet postgres ltree module for multiple databases
##
# PostgreSQL module
#
#
## wraps puppetlabs/postgresql
## https://forge.puppetlabs.com/puppetlabs/postgresql
class mystack::postgresql {
class { 'postgresql::globals':
@nini
nini / gist:c5e5471ac8ca8319462b
Last active August 29, 2015 14:23
Vagrant stuff
export VAGRANT_LOG=debug
or vagrant up --debug
Restart host only adapter after network switch / sleep:
VBoxManage controlvm "INTPASS_default_1434544929410_91614" setlinkstate2 off
VBoxManage controlvm "INTPASS_default_1434544929410_91614" setlinkstate2 on
@nini
nini / Post
Last active August 29, 2015 14:23
Postgres
# use db
\c dbname
# describe table
\d+ tablename
# display history
\s
@nini
nini / gist:bc00196b89f5c519c393
Created July 8, 2015 14:11
Keyboard switcher
setxkbmap -layout "us,de,ru(phonetic)" -option grp:switch,grp:win_space_toggle,grp_led:scroll
chattr +i /etc/deploy/staging/application.ini
chattr -i /etc/deploy/staging/application.ini
lsattr
@nini
nini / gist:7f54162e3f0a0e4a6dfa
Created July 31, 2015 08:34
PHP enable error display
<?php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
git flow feature start "$(pbpaste | tr -c '[:alnum:]' '-' | tr -s '-' '-')"