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
#!/usr/bin/env php | |
<?php | |
#accept command line arg for length. | |
$options = getopt("l:"); | |
if(empty($options['l'])){ | |
$length = 32; | |
}else{ | |
$length = (int) $options['l']; | |
} | |
#may contain unprintable characters. Base64 encode for ease of use. Double the lenght to make sure we have enough data to clip. |
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
#Its a one line command which takes 1 arg, a path to the file, which is bundle4.jpg in this case. | |
php -r 'echo chr(10) . "data:" . mime_content_type($argv[1]) . "," . base64_encode(file_get_contents($argv[1])) . chr(10);' ./bundle4.jpg | pbcopy -Prefer txt |
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 | |
# Updates ip address in the noip DDNS serivce. | |
# Assumes curl + gnu tools | |
# Param descriptions taken from API docs. | |
# http://www.noip.com/integrate/request | |
#Config |
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 | |
# ------------------------------ | |
# START CONFIGURATION SECTION | |
# | |
$launch_url = "http://www.imsglobal.org/developers/BLTI/tool.php"; | |
$key = "12345"; | |
$secret = "secret"; | |
$launch_data = 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 | |
/* | |
* Configure Logger instance / error mailer functionality | |
* Assumes you are autoloading monolog. | |
*/ | |
$initLogger = function(){ | |
//needed for the mail logger. @see http://symfony.com/doc/current/cookbook/logging/monolog_email.html | |
$transport = new Swift_SmtpTransport($config['smtp']['host'],$config['smtp']['port'],$config['smtp']['security']); | |
$swiftMessage = new Swift_Message(); | |
$swiftMessage->addTo('[email protected]'); |
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 | |
if(php_sapi_name()!=="cli"){ | |
echo "Must be run from the command line."; | |
}; | |
/** | |
* Setup a magento instance so we can run this export from the command line. | |
*/ |
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 | |
#see your mojo profile for this key. Will change if your password is every updated. | |
mojo_access_key="xxxxx" | |
#A specific agent id number. See mojo url for id number. | |
mojo_assignee_id="xxxxx" | |
#URL to check for tickets. You can changes the filters to suite your need. | |
#This one only finds issues assigned to specific id with a status of new or in progress |
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
# space150 vine-to-GIF | |
# given a vine.co uri, downloads the MP4 and creates an image sequence / GIF from it | |
# requires ruby, ffmpeg, and imagemagick | |
require 'open-uri' | |
require 'nokogiri' | |
id = ARGV[0] | |
# try to convert from URL to id. |
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 | |
$video = __DIR__ . '/video.mp4'; | |
$fps = 4; | |
# Convert an MP4 to a GIF - Requires ffmpeg | |
`ffmpeg -i "$video" -pix_fmt rgb24 -r $fps "$video.gif"` | |
# optimize the gif - Requires imagemagick | |
# via http://superuser.com/questions/436056/how-can-i-get-ffmpeg-to-convert-a-mov-to-a-gif |
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 | |
# | |
# matrix: matrix-ish display for Bash terminal | |
# Author: Brett Terpstra 2012 <http://brettterpstra.com> | |
# Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/> | |
# | |
# A morning project. Could have been better, but I'm learning when to stop. | |
### Customization: | |
blue="\033[0;34m" |