This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var CommentController = { | |
| current_users: [], | |
| create: function(req, res) { | |
| this.current_users.push('yada'); | |
| } | |
| } | |
| module.exports = CommentController; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| void say(char *string[]) { | |
| printf("%s\n", *string); | |
| } | |
| int add(int a, int b, void (*callback)(char *string[])) { | |
| int sum = a + b; | |
| char* mesg; | |
| asprintf(&mesg, "%d + %d = %d", a, b, sum); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(cbhellorest_greetings_controller, [Req]). | |
| -compile(export_all). | |
| hello('GET', []) -> | |
| {json, [{message, "hey"}]}; | |
| hello('POST', []) -> | |
| NewGreeting = greeting:new(id, Req:post_params("message")), | |
| {ok, SavedGreeting} = NewGreeting.save(), | |
| {json, [{message, SavedGreeting:attributes}]}. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var util = require('util'); | |
| var GAPI = require('gapitoken'); | |
| var gapi = new GAPI({ | |
| iss: '1074036960964-p8827i23hcprb8dr959uh2a6irk1jgfe@developer.gserviceaccount.com', | |
| scope: 'https://storage.googleapis.com', | |
| keyFile: './config/google-key.pem' | |
| }, function(error){ | |
| console.log(error); | |
| console.log(gapi); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe Manage::Collections::AssetsController do | |
| use_vcr_cassette | |
| let!(:collection) {FactoryGirl.create :collection} | |
| let!(:employee) {FactoryGirl.create :employee} | |
| it 'creates an asset' do | |
| collection.header.should_not be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puts 'Counting up to 100' | |
| 100.times do |i| | |
| print "\rcurrent number: #{i + 1}" | |
| sleep 0.1 | |
| end | |
| puts '' | |
| puts 'Done' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ((15, 'less_than', 30) == true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CalendarItem < Section | |
| include Mongoid::Document | |
| field :url | |
| def calendar | |
| Icalendar.parse(open(self.url).read).first | |
| end | |
| end |