Skip to content

Instantly share code, notes, and snippets.

View printminion's full-sized avatar
💭
Time flies like an arrow; fruit flies like a 🍌

@printminion printminion

💭
Time flies like an arrow; fruit flies like a 🍌
View GitHub Profile
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
sha256sum -b ./dbapp.war > ./dbapp.sha256
gsutil cp ./dbapp.war ./dbapp.sha256 gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/
gsutil setacl public-read gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/dbapp.war
gsutil setacl public-read gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/dbapp.sha256
cd ${WORKSPACE}
gcutil addinstance dbapp-db dbapp-app1 dbapp-lb \
--project "opscode.com:stathy" --image "/projects/opscode.com:stathy/images/centos-latest" \

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

@printminion
printminion / giffify.bat
Last active August 29, 2015 14:27 — forked from ndorigatti/giffify.bat
Giffify - easily create optimised GIFs from a video (On Windows). This assumes you have ffmpeg.exe in the same folder or in the System PATH.
@echo off
REM !/bin/sh
REM License for any modification to the original (linked below):
REM ----------------------------------------------------------------------------
REM "THE BEER-WARE LICENSE" (Revision 42):
REM Sebastiano Poggi wrote this file. As long as you retain this notice you
REM can do whatever you want with this stuff. If we meet some day, and you think
REM this stuff is worth it, you can buy me a beer in return.
REM ----------------------------------------------------------------------------
REM
@printminion
printminion / deploy.sh
Created October 18, 2015 18:25 — forked from joestump/deploy.sh
Using modern JavaScript and CI tooling for Google Apps Scripts
#!/bin/bash
npm run build
gas deploy -s ./conf/$CLIENT_SECRETS -c ./conf/$OAUTH_CREDENTIALS -b ./build -f $GAS_FILE_ID
function doGet() {
var app = UiApp.createApplication();
var t = app.createTextBox().setName('t').setId('t');
app.add(t);
app.add(app.createButton('OK', app.createServerHandler('click').addCallbackElement(t)));
return app;
}
function click(e) {
var app = UiApp.getActiveApplication();
if(e.parameter.t == '') return;
function doGet() {
var app = UiApp.createApplication();
var t = app.createTextBox().setName('t').setId('t');
app.add(t);
app.add(app.createButton('OK', app.createServerHandler('click').addCallbackElement(t)));
return app;
}
function click(e) {
var app = UiApp.getActiveApplication();
if(e.parameter.t == '') return;
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
(function (window, checkNode){
var p = {};
var m = {
registerObserver: function() {
if (typeof(window.WebKitMutationObserver) == "undefined") return;
p.observer = new window.WebKitMutationObserver(function(mutationRecords) {
mutationRecords.forEach(function(mutationRecord) {
for (var i = 0; i < mutationRecord.addedNodes.length; ++i)
/*
Chrome Packaged app Bluetooth API test
Before interacting with a BT device, you need to :
1) get the device MAC and service UUID with startDiscovery and getServices methods
2) request permission with chrome.permissions.request
3) add the service profile with chrome.bluetooth.addProfile (a profile is only {uuid:'xxxxxxx...'})
*/
// onConnection callback
chrome.bluetooth.onConnection.addListener(