server-side:
- navigate to your user folder /home/username/
- create a folder for your repo. 'repo'
- create a folder inside of your repo. call it whatever. 'test'
- cd into folder.
- git init --bare
local:
- navigate to local repo
#!/usr/bin/env ruby | |
#Utility to perform routine backups for CallCenter Recordings | |
require 'rubygems' | |
require 'aws/s3' | |
#Parent of directory tree for recordings | |
directory = ARGV.shift | |
#We're shipping the output to S3, so we need to define creds |
# Methods bound to Step1 dialog | |
stepone_submit = -> | |
$("#stepone").dialog "destroy" | |
$("#steptwo").dialog | |
title: "Refine Search" | |
resizable: false | |
height: 500 | |
width: 400 | |
modal: true | |
closeOnEscape: false |
server-side:
local:
require 'mongoid' | |
#`Job` _Job Model_ bound to the mongo database. Handles the dynamic properties of the mongo documents. | |
# Helper data model to define the dynamic properties of jobs which has no standard definition between | |
# all the aggregated data | |
class Job | |
include Mongoid::Document | |
field :company, :type => String, :default => "" | |
field :location, :type => String, :default => "" |
Can't mass-assign protected attributes: rinkleagues, rinksurfaces, developmentalprograms | |
app/controllers/rinks_controller.rb:43:in `new' | |
app/controllers/rinks_controller.rb:43:in `create' | |
{"utf8"=>"✓", | |
"authenticity_token"=>"x1fV0Snf9A7f2938b/UplmuVFRvPytZSPlCzxO07KPw=", | |
"rink"=>{"name"=>"", | |
"address1"=>"", | |
"address2"=>"", |
$ sudo apt-get purge nvidia-current | |
$ sudo apt-get install linux-source linux-headers-generic linux-image | |
$ sudo apt-get install nvidia-current nvidia-preferences |
execute "rake db:setup" do | |
environment ({'RAILS_ENV' => 'production'}) | |
command "cd #{node[:fatfree][:dir]}; rake db:setup; touch .db-created" | |
creates "#{node[:fatfree][:dir]}/.db-created" | |
action :run | |
end |
RESTful HTTP Response Codes | |
Recently I have been building RESTful APIs in Ruby on Rails so I decided to compile a list of HTTP Status Codes to use. This is just a guideline. | |
Successful Responses: | |
200 (OK) – everything is fine | |
201 (Created)– resource successfully created | |
202 (Accepted) – the call returned but the request was queued up. Somewhat async behavior. Unclear how to communicate error, possibly through the resource state | |
204 (No Content) – A successful DELETE | |
Unsuccessful Responses: | |
400 (Bad Request) – the request could not be understood |
#!/bin/bash | |
# Log output: | |
# | |
# * 51c333e (12 days) <Gary Bernhardt> add vim-eunuch | |
# | |
# The time massaging regexes start with ^[^<]* because that ensures that they | |
# only operate before the first "<". That "<" will be the beginning of the | |
# author name, ensuring that we don't destroy anything in the commit message | |
# that looks like time. |
# by default you only get 1000 objects at a time | |
# so you have to roll your own cursor | |
S3.connect! | |
objects = [] | |
last_key = nil | |
begin | |
new_objects = AWS::S3::Bucket.objects(bucket_name, :marker => last_key) | |
objects += new_objects |