Skip to content

Instantly share code, notes, and snippets.

View hayduke19us's full-sized avatar
🐙

matthew sullivan hayduke19us

🐙
View GitHub Profile
@hayduke19us
hayduke19us / 0_reuse_code.js
Last active August 29, 2015 14:22
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
# Unbind default prefix of Ctrl-b
unbind C-b
# Bind prefix to Ctrl-a instead of Ctrl-b
set -g prefix C-a
# Binding the prefix to Ctrl-a requires and additional configuration
# to allow us to send that prefix to other commands through tmux
# when we need it, like with Vim and Bash. Now we can send the
# Ctrl-a command through to other programs by pressing Ctrl-a twice.
{
"data"=>{
"reports"=>{
"1"=>[
{
"grower_id"=>4,
"irrigation"=>"",
"id"=>123,
"staging"=>"test",
"weather"=>"",
{
:success=>true,
:message=>"Sync successful",
:data=>{:growers=>{4=>[]},
:farms=>{4=>[]},
:fields=>{4=>[]},
:reports=>{4=>[{:id=>123, :new_id=>123}]},
:corn_stand=>{4=>[]},
:corn_yield=>{4=>[]},
:diseases=>{4=>[]},
{
"data"=>{
"others"=>{
"2"=>[
{
"id"=>222,
"report_id"=>123,
"lat"=>37.33233261108398,
"comment"=>"test with STDOUT and new_relic",
"long"=>-122.0312194824219
# aws-sdk
# aws-sdk-resources
# rmagick
class ResizeImages
attr_reader :all_image_names, :s3
attr_accessor :width, :height, :image_file_name
def initialize args
[#<CornYieldSample id: 21, row_width: 30, row_length: 17.417, harvest_ears: 28, kernels: [400, 450, 432, 500, 550], bushel_size: 90000, yield: 144.0, report_id: 482, created_at: "2015-03-12 16:47:32", updated_at: "2015-05-04 19:02:06", archive: true>,
#<CornYieldSample id: 30, row_width: nil, row_length: 0.0, harvest_ears: 28, kernels: [624, 688, 774], bushel_size: 90000, yield: 216.0, report_id: 687, created_at: "2015-04-13 19:19:22", updated_at: "2015-04-13 19:19:22", archive: false>,
#<CornYieldSample id: 29, row_width: nil, row_length: 0.0, harvest_ears: 30, kernels: [640, 756, 720, 608], bushel_size: 90000, yield: 227.0, report_id: 687, created_at: "2015-04-13 19:19:22", updated_at: "2015-04-13 19:19:22", archive: false>,
#<CornYieldSample id: 116, row_width: nil, row_length: 0.0, harvest_ears: 30, kernels: [666, 640, 608], bushel_size: 90000, yield: 212.0, report_id: 2542, created_at: "2015-08-03 19:18:34", updated_at: "2015-08-03 19:18:34", archive: false>,
#<CornYieldSample id: 115, row_width: nil
def set_boot
`sudo bless -mount /Volumes/Narnia -setboot`
end
def restart_machine
`sudo shutdown -r now`
end
set_boot
restart_machine
require "socket"
require "json"
require "colorize"
require 'securerandom'
# require "./lib/models/weather"
# this is where it was connecting and not disconnecting
## ===> Sequel.connect(database_urls.last)
User = Struct.new("User", :number, :position)
def matching_number?(last, current)
last.number == current.number
end
def create_users(count)
array = []
count.times do
u = User.new