Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh [email protected]
Add ssh fingerprint and enter password provided in email
| # | |
| # flattener.rb | |
| # | |
| module Flattener | |
| class ::InvalidInputError < StandardError; end | |
| def self.execute(array) | |
| raise InvalidInputError unless can_be_flattened?(array) | |
| process(array) |
| Story Creation: | |
| { | |
| "kind": "story_create_activity", | |
| "guid": "1081752_16", | |
| "project_version": 16, | |
| "message": "Ace Dimasuhid added this feature", | |
| "highlight": "added", | |
| "changes": [ | |
| { | |
| "kind": "story", |
| var config = require("../config/config.js") | |
| function getUrl(name) { | |
| return "http://" + config.ip + ":3003/media/" + name | |
| } | |
| video1 = { | |
| id: 1, | |
| transitions: { | |
| initial: getUrl(""), |
| class Numbers | |
| extend Piliponi | |
| def self.csv_to_array(num_array, map_num) | |
| num_array.collect{ |num| clean num[map_num] } | |
| end | |
| def self.rejected(numbers) | |
| numbers.select{ |num| !plausible? num } | |
| end |
| values: | |
| - "AAA" | |
| - "AARP" | |
| - "ABARTH" | |
| - "ABB" | |
| - "ABBOTT" | |
| - "ABBVIE" | |
| - "ABC" | |
| - "ABLE" | |
| - "ABOGADO" |
| //This is an example of how to scrape the web using PhantomJS and jQuery: | |
| //source: http://snippets.aktagon.com/snippets/534-How-to-scrape-web-pages-with-PhantomJS-and-jQuery | |
| //http://phantomjs.org/ | |
| var page = new WebPage(), | |
| url = 'http://localhost/a-search-form', | |
| stepIndex = 0; | |
| /** | |
| * From PhantomJS documentation: |
| require 'sinatra' | |
| require 'action_mailer' | |
| class Mailer < ActionMailer::Base | |
| def contact | |
| mail( | |
| :to => "[email protected]", | |
| :from => "[email protected]", | |
| :subject => "Test") do |format| | |
| format.text |
Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh [email protected]
Add ssh fingerprint and enter password provided in email
| //Backbone Baseview for handling zombies in large applications | |
| //From Backbone Fundamentals by Addy Osmani | |
| var BaseView = function(options){ | |
| this.bindings = []; | |
| Backbone.View.apply(this.[options]); | |
| }; | |
| _.extend(BaseView.prototype, Backbone.View.prototype, { | |
| bindTo: function(model, ev, callback){ |
| module FullSearchable | |
| def searchable(scope_name, *attrs) | |
| raise ArgumentError if attrs.blank? | |
| define_singleton_method("#{scope_name}") do |terms| | |
| return if terms.blank? | |
| composed_scope = self.scoped | |
| terms.downcase.split(' ') .each do |term| | |
| composed_scope = composed_scope.where(create_query(attrs, term)) |