Skip to content

Instantly share code, notes, and snippets.

View steverob's full-sized avatar

Steve Robinson steverob

View GitHub Profile
@steverob
steverob / log
Created March 28, 2013 09:28
Foreman Log
14:57:08 web.1 | (9.3ms) COMMIT
14:57:08 web.1 | (0.2ms) BEGIN
14:57:08 web.1 | SQL (0.4ms) INSERT INTO "tweet_stores" ("created_at", "tweet", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Thu, 28 Mar 2013 09:27:05 UTC +00:00], ["tweet", "2010 Jaguar #33 RSR XKR GT (2012/5/26)"], ["updated_at", Thu, 28 Mar 2013 09:27:05 UTC +00:00]]
14:57:08 web.1 | (21.8ms) COMMIT
14:57:08 web.1 | (0.3ms) BEGIN
14:57:08 web.1 | SQL (0.8ms) INSERT INTO "tweet_stores" ("created_at", "tweet", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Thu, 28 Mar 2013 09:27:06 UTC +00:00], ["tweet", "#autonews #autosales 2014 Mercedes-Benz B Class EV Debuts at New York Show [Photo Gallery] http://t.co/BaXgSrer9C"], ["updated_at", Thu, 28 Mar 2013 09:27:06 UTC +00:00]]
14:57:08 web.1 | (27.2ms) COMMIT
14:57:08 web.1 |
14:57:08 web.1 |
14:57:08 web.1 | Started GET "/users/sign_in" for 127.0.0.1 at 2013-03-28 14:57:06 +0530
@steverob
steverob / responsive_tables.html
Created October 8, 2013 10:41
Responsive Tables
<html>
<head>
<style type="text/css">
@media(max-width: 1024){
.table-responsive th.hidden-1024{
display: none;
}
}
@media(max-width: 800){
@steverob
steverob / slide-down.coffee
Created October 18, 2013 06:19
Slide Toggle a div below rows of a table
$('.slidedown-pane-row').hide()
$('#rows').on 'click', '.row', ->
$(this).next('.slidedown-pane-row').slideToggle(500)
false
$('#rows').on 'click', '.row', ->
$(this).next('.slidedown-pane-row').find('div').slideToggle(500)
@steverob
steverob / blink.pde
Last active January 1, 2016 10:49
Arduino - Led Blink (File -> Examples -> Basics -> Blink)
@steverob
steverob / music.pde
Last active January 1, 2016 10:49
Play music using a Piezo sounder by pressing keys on the keyboard
int speakerPin = 12;
int input = 0;
int numNotes = 8;
int notes[] = {'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
int tones[] = {261, 294, 329, 349, 392, 440, 493, 523};
void setup()
{
Serial.begin(9600);
@steverob
steverob / strobe.pde
Created December 26, 2013 13:24
Johnny-five Strobe
var five = require("johnny-five"),
board = new five.Board();
var LEDPIN = 13;
board.on("ready", function() {
this.pinMode(LEDPIN, 1);
var val = 0;
this.loop( 100, function() {
@steverob
steverob / ambient-display.pde
Last active January 1, 2016 10:49
Automatically adjust Ubuntu monitor brightness based on Ambient lighting
var five = require("johnny-five"),
board, photoresistor;
var exec = require('child_process').exec;
board = new five.Board();
board.on("ready", function() {
// Create a new `photoresistor` hardware instance.
photoresistor = new five.Sensor({
@steverob
steverob / isalive.sh
Last active January 2, 2016 16:59
Check status of a web app
wget --timeout=3 --tries=1 --spider --no-check-certificate http://mysite.com
if [ $? -ne 0 ];then
echo "Site Down" | mail -s "Site Down" admin@yourdomain.com
fi
#Make the script executable
# $ chmod +x isalive.sh
#Add it to crontab (say every 10 minutes)
@steverob
steverob / .zshrc
Created February 2, 2014 17:35
zshrc
# "$HOME/.rvm/scripts/rvm" ]] && . “$HOME/.rvm/scripts/rvm” Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="blinks"
# Example aliases
@steverob
steverob / .profile
Created February 2, 2014 17:37
profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022