This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap "sudo phpenmod xdebug" EXIT | |
sudo phpdismod xdebug | |
vendor/bin/phpunit "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// experiment with 'rich types' in php? | |
class RichTypeError extends TypeError | |
{ | |
// maybe customize this | |
} | |
class _email | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let mut array: [i32; 5] = [5, 6, 3, 2, 8]; | |
let sorted = bubble_sort(array); | |
for x in &sorted { | |
println!("{0}", x); | |
} | |
assert_eq!(sorted, [2, 3, 5, 6, 8], "Failed to sort array."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Model\Entity; | |
use Cake\ORM\Entity as CakeEntity; | |
use Cake\Datasource\EntityTrait; | |
class Entity extends CakeEntity | |
{ | |
use EntityTrait { | |
get as traitGet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Vundle -- A vim plugin manager | |
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim | |
# Test terminal 256 color support | |
bash < <(curl https://gist.githubusercontent.com/kevinquinnyo/1598610d133e4f9f872de1444677a5cf/raw/cbcc804a99efa28fed6d9299c8e1cedca2c9bcc7/bash-color-test.bash) | |
) | |
# Test vim 256 color support | |
vim "+runtime syntax/colortest.vim" | |
# Close vim, try again with this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
"set paste | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stolen from http://www.commandlinefu.com/commands/view/6533/print-all-256-colors-for-testing-term-or-for-a-quick-reference | |
( x=`tput op` y=`printf %$((${COLUMNS}-6))s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done; ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# .git/hooks/post-commit | |
txtred=$(tput setaf 1) | |
txtreset=$(tput sgr0) | |
git log -1 HEAD --pretty=format:%s | egrep -o '[A-Z]{2}-[0-9]+ #time' || \ | |
echo -ne "\n${txtred} [!] Missing JIRA smart commit.${txtreset}\n\n" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!py | |
def run(): | |
states = {} | |
cache_private_ips = __salt__['tss.get_role_ips']('cache') | |
states['test-tss-module'] = { | |
'cmd.run': [ | |
{'name': 'echo {0} > /tmp/tss-module-test.txt'.format(cache_private_ips)}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_role_ips(role, interface='eth1'): | |
billing_id = __pillar__['cluster']['client']['billing_id'] | |
cluster_name = __pillar__['cluster']['name'] | |
ips = [] | |
interfaces = __salt__['mine.get']('{0}*{1}-{2}.my-platform-domain.com'.format(role, billing_id, cluster_name), 'network.interfaces') | |
for minion, interface in interfaces.iteritems(): | |
for name, data in interface.iteritems(): | |
if name == interface: | |
ips.append(data['inet'][0]['address']) | |
return ips |
NewerOlder