Skip to content

Instantly share code, notes, and snippets.

@jerico
jerico / photobooth.sh
Created December 21, 2011 17:01
Very rough photobooth script using gPhoto2, ImageMagick, and CUPS.
#! /usr/bin/env bash
# Extremely rough photobooth bash script
# It depends on the following:
# - gPhoto2: for camera control through usb
# - ImageMagick: photo-manipulation suite
# - CUPS: printer driver with command-line printing utilities
# - beep: for the countdown sound
save_dir=./processed
@jerico
jerico / dayone-ruby.rb
Created January 18, 2013 05:36
dayone-ruby.rb
#!/usr/bin/env ruby
# Requires chronic and trollop: gem install chronic trollop
# I mapped it to 'j' by adding 'alias j=~/path/dayone-ruby.rb' to .bashrc
# j --date "yesterday" --starred "entry text"
# j -d "4pm" -s "entry text"
# j "entry text"
# j -f textfile.txt
require 'rexml/document'
@jerico
jerico / quiet-facebook.js
Last active August 29, 2015 14:02
Implemented quiet-facebook.css for Tampermonkey
// ==UserScript==
// @name Quiet Facebook
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match https://www.facebook.com
// @copyright 2012+, You
// ==/UserScript==
// ==UserScript==
// @name Quiet Youtube
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://www.youtube.com
// @copyright 2012+, You
// ==/UserScript==
var css = document.createElement("style");
@jerico
jerico / bitbucket.bat
Created October 13, 2014 20:01
Create bitbucket repos in command line with prompt
@echo off
echo "Enter Username"
set /p Username=
echo "Password"
set /p Password=
echo "Repository Name"
set /p RepoName=
curl --user %Username%:%Password% https://api.bitbucket.org/1.0/repositories/ --data name=%RepoName% --data is_private='true'
@jerico
jerico / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jerico
jerico / salarium.sh
Last active August 9, 2017 05:27
Salarium Auto Time-in Time-out
# Email and password must be escaped e.g. jerico%40instinctivedrives.com
# If this will be used in a cron, '%' must be escaped, e.g. jerico\%40instinctivedrives.com
# TIME IN
curl -c /tmp/salarium-cookie.txt 'https://app.salarium.com/users/login' --data 'email=EMAIL_HERE&password=PASSWORD_HERE' && curl -b /tmp/salarium-cookie.txt https://app.salarium.com/employees/ebundy_clock --data 'log_type=TIME+IN'
# TIME OUT
curl -c /tmp/salarium-cookie.txt 'https://app.salarium.com/users/login' --data 'email=EMAIL_HERE&password=PASSWORD_HERE' && curl -b /tmp/salarium-cookie.txt https://app.salarium.com/employees/ebundy_clock --data 'log_type=TIME+OUT'
# Cron Monday-Friday 1pm