This file contains hidden or 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 | |
| usort($unsortedObjectArray, function( $a, $b ) { | |
| if ($a->weight == $b->weight) { | |
| return 0; | |
| } | |
| return ($a->weight < $b->weight) ? -1 : 1; | |
| }); |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # | |
| # Converts any integer into a base [BASE] number. I have chosen 62 | |
| # as it is meant to represent the integers using all the alphanumeric | |
| # characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
| # | |
| # I plan on using this to shorten the representation of possibly long ids, | |
| # a la url shortenters | |
| # |
This file contains hidden or 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
| tracker = ga.getByName('tracker') | |
| tracker.get('clientId') |
This file contains hidden or 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 | |
| use Swagger\Annotations as SWG; | |
| App::uses('AppController', 'Controller'); | |
| /** | |
| * Users Controller | |
| * @SWG\Resource( | |
| * apiVersion="0.2", | |
| * swaggerVersion="1.1", | |
| * basePath="http://api.myhost.local/api", | |
| * resourcePath="/users" |
This file contains hidden or 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
| mysql -u username dbname -e 'describe db_table'|awk '{print " protected $"$1";"};' |
This file contains hidden or 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/sh | |
| ZONE="my-tld.com" | |
| RESOURCE="some-host" | |
| INTERFACE="eth0" | |
| ADDR=$(ifconfig $INTERFACE | grep "inet addr" | awk -F: '{print $2}' | awk '{print$1}') | |
| cli53 rrcreate $ZONE $RESOURCE A $ADDR -x 3600 -r |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Disabled</key> | |
| <false/> | |
| <key>KeepAlive</key> | |
| <false/> | |
| <key>Label</key> | |
| <string>com.zircote.headlessvm</string> |
This file contains hidden or 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 | |
| COMPOSER=$(type -p "composer.phar") | |
| if [ -x "${COMPOSER}" ]; then | |
| ${COMPOSER} self-update > /dev/null | |
| else | |
| $(type -p "php") -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));" | |
| fi | |
| ${COMPOSER} $@ |
This file contains hidden or 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
| [ zircote ~/Workspace/Jazsl ] zf cluster-status jazsl-server zcsm | |
| Cluster Members: | |
| ┌──────────┬───────────────┬───────────────┬────────────────────────────────────────────────────────────┐ | |
| │Server ID │Status │Instance-Name │URI │ | |
| ├──────────┼───────────────┼───────────────┼────────────────────────────────────────────────────────────┤ | |
| │25 │OK │i-07982fff │ec2-00-00-00-01.compute-1.amazonaws.com │ | |
| ├──────────┼───────────────┼───────────────┼────────────────────────────────────────────────────────────┤ | |
| │28 │OK │i-25765fff │ec2-00-00-00-00.compute-1.amazonaws.com │ | |
| ├──────────┼───────────────┼───────────────┼────────────────────────────────────────────────────────────┤ | |
| │31 │OK │i-2e988fff │ec2-00-00-00-00.us-west-1.compute.amazonaws.com │ |
This file contains hidden or 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 | |
| # | |
| # @c Robert Allen zircote@gmail.com | |
| # | |
| # /usr/bin/ec2_name | |
| if [ -f /etc/profile.d/aws-apitools-common.sh ]; then | |
| . /etc/profile.d/aws-apitools-common.sh | |
| export PATH=/opt/aws/bin:$PATH | |
| fi |