Skip to content

Instantly share code, notes, and snippets.

View m3talsmith's full-sized avatar

Michael Christenson II m3talsmith

View GitHub Profile
@m3talsmith
m3talsmith / install-docker.txt
Created March 25, 2014 02:30
How to install docker on 13.10
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get --yes install linux-image-extra-`uname -r`
sudo apt-get --yes install lxc-docker wget python-software-properties python g++ make cgroup-lite software-properties-common
sudo wget -O /etc/init/docker.conf https://raw.github.com/dotcloud/docker/master/contrib/init/upstart/docker.conf
sudo service docker restart
var CommentController = {
current_users: [],
create: function(req, res) {
this.current_users.push('yada');
}
}
module.exports = CommentController;
@m3talsmith
m3talsmith / scope-binding-closure.js
Last active August 29, 2015 14:06
Showing the principle of javascript scope binding
var bob = (function (name) {
var char = {
name: name,
say: function (message) { this.logger(this.name + " says: " + message); },
logger: function (message) { console.log(message); }
};
return char;
})("Bob");
@m3talsmith
m3talsmith / steppinit.rb
Created January 29, 2015 14:44
a demonstration of updating a sorted item
class Step
attr_accessor :id, :position
// all_steps = [Step.new(id: 1), Step.new(id: 2), Step.new(id: 3)]
def move_to(position)
new_steps = all_steps
new_step.delete_at(new_steps.index(self))
new_steps.insert(position, self)
new_steps.each_with_index do |step, index|
%span= link_to "Destroy", project_path(:id => @project.id), :method => :destroy, :confirm => "Are you sure you want to destroy this project? This will effect all work tasks and people related to this project."
<div id="content">
<h2>
Managing Your Current
Fields
</h2>
<div class="top_pane">
<script type="text/javascript" src="/javascripts/application.js?1248187733"/>
<script type="text/javascript" src="/javascripts/filters.js?1248187733"/>
<script type="text/javascript" src="/javascripts/jquery.form.js?1246544703"/>
Feature: Manage Users
So that I can manage my user base
As an administrator
I want to be able to list, create, view, update, activate, deactivate, and archive all users
Background: # features/manage_users.feature:6
Given the following users: # features/step_definitions/manage_users_steps.rb:1
| name | login | password | is_admin |
| Test Admin | test_admin | noone | true |
| Basic User | basic_user | loluser | false |
Apache CouchDB 0.11.0a811975 (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.
[info] [<0.32.0>] Apache CouchDB has started on http://127.0.0.1:5984/
[info] [<0.96.0>] 127.0.0.1 - 'GET' /
[info] [<0.96.0>] Response code: 200
[info] [<0.96.0>] 127.0.0.1 - 'GET' /
[info] [<0.96.0>] Response code: 200
[info] [<0.96.0>] 127.0.0.1 - 'DELETE' /test_suite_db/
[info] [<0.96.0>] Response code: 404
[info] [<0.96.0>] 127.0.0.1 - 'DELETE' /test_suite_db/
. /usr/local/lib/couchdb/erlang/lib/couch-0.11.0a811975/priv/couchspawnkillable /usr/local/bin/couchjs /usr/local/share/couchdb/server/main.js
kill -9 97773
reset
ReferenceError: reset is not defined
[Mon, 07 Sep 2009 04:01:35 GMT] [info] [<0.287.0>] 127.0.0.1 - 'GET' /
[Mon, 07 Sep 2009 04:01:35 GMT] [info] [<0.287.0>] Response code: 200
[Mon, 07 Sep 2009 04:01:35 GMT] [info] [<0.287.0>] 127.0.0.1 - 'DELETE' /test_suite_db/
[Mon, 07 Sep 2009 04:01:35 GMT] [info] [<0.287.0>] Response code: 200
[Mon, 07 Sep 2009 04:01:35 GMT] [info] [<0.287.0>] 127.0.0.1 - 'DELETE' /test_suite_db/