Skip to content

Instantly share code, notes, and snippets.

View radavis's full-sized avatar

Richard Davis radavis

View GitHub Profile
module Blackjack
class Card
attr_reader :value, :suit
def initialize(value, suit)
@value = value
@suit = suit
end
def to_s
@radavis
radavis / 0_reuse_code.js
Last active August 29, 2015 14:13
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

System Build for RFID Logger

  • Enclosure
    • Foxconn Brazos AT-5570 Barebones System - $100
      • CPU: AMD Dual Core C70 1.0GHz APU
      • RAM: 1 x 204Pin SO-DIMM DDR3 1066 (8GB Max)
      • HDD: 1 x SATA 3.0GBb/s (assuming 2.5" drive)
      • 10/100/1000 Ethernet
      • 4 x USB 3.0
  • RAM
require "pry"
require "ipaddr"
require "net/ping"
require "net/http"
require "uri"
PING_TIMEOUT = 0.1
PORTS = [3000, 4567]
START_IP = ""
NETMASK = 24
@radavis
radavis / application.js
Created January 12, 2015 18:40
Getting Rails and jQuery Tablesorter to play nice
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<h1>Original Link</h1>
<div>
<a href="https://www.youtube.com/watch?v=qKxDzyHPo0o">YouTube Link</a>
</div>

Sample ffmpeg Commands

Convert to 480p

$ ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4

Convert to 720p via scaling, copy audio

$ ffmpeg -i input.mp4 \
@radavis
radavis / install
Last active August 29, 2015 14:14
Install Development Tools
#!/bin/bash
set -e
exec > >(tee $0.log) 2>&1
echo "---Install Apple Xcode---"
read -p "Have you installed Apple Xcode? (y/n): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Please run the following command and restart before continuing:"

PC Build

First Stab ~ $1478

Part Description Power Price URL
Monitor Asus VG248QE 24" N/A $265 link
Graphics Card Asus GeForce GTX 970 4GB 145W $340 link
Processor Intel Core i7-4790K 4.0GHz 84W $280 link
Motherboard ASUS Z97-PRO ATX 250W $188 link
-- recipes with comments
-- remove tables
DROP TABLE recipes CASCADE;
DROP TABLE comments CASCADE;
-- build tables
CREATE TABLE recipes(
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL