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
| (-> | |
| dfd = $.Deferred() | |
| Array::indexOf = Array::indexOf || (e) -> $.inArray e, @ | |
| Array.isArray = Array.isArray || (e) -> Object::toString.call(e) is '[object Array]' | |
| String::trim = String::trim || -> $.trim.call(@, @) | |
| dependencies = [] | |
| dependencies.push 'json2' if !window.JSON | |
| dependencies.push 'matchMedia' if !window.matchMedia |
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
| Array(16).join('wat' - 1) + ' Batman!' |
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
| define -> | |
| bus = (-> window.message_bus || window.message_bus = {})() | |
| # Publish/Subscribe Functionality for classes | |
| # @mixin | |
| pubsub_module = | |
| ### | |
| @param [String] topic The topic as a channel | |
| on which to publish data | |
| @param [*] data The data to be published |
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 app.Views.Automaton | |
| defaults = | |
| interval: 100 | |
| (@$cells, options) -> | |
| @options = $.extend {}, defaults, options | |
| @_bindHandlers! | |
| step: (gen = 0) ~> | |
| @$cells.each (_, cell) ~> |
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
| -webkit-border-radius: 1px; | |
| -moz-border-radius: 1px; | |
| border-radius: 1px; |
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
| { | |
| "remove-empty-rulesets": true, | |
| "always-semicolon": true, | |
| "color-case": "lower", | |
| "block-indent": " ", | |
| "element-case": "lower", | |
| "leading-zero": false, | |
| "quotes": "single", | |
| "space-before-colon": "", | |
| "space-after-colon": " ", |
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
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = 'debian_jessie_64' | |
| config.vm.box_url = 'http://vagrant.zorbash.com/boxes/debian_jessie_64.box' | |
| # Make the vm accessible at the defined ip | |
| config.vm.network :private_network, ip: "192.168.77.35" | |
| config.vm.network :forwarded_port, guest: 22, host: 11234 |
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 'oauth2' | |
| require 'net/http' | |
| require 'json' | |
| CID = 'my_cid' | |
| PAS = 'my_pass' | |
| RDR = 'rdr_url' | |
| # OAuth2 client object | |
| def client |
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 MainController < ApplicationController | |
| def songs_random | |
| row = ActiveRecord::Base.connection | |
| .execute("SELECT * FROM songs ORDER BY RANDOM() LIMIT 1;")[0] | |
| render json: { song: row.delete_if { |key, _| key.to_s =~ /^[0-9]+$/ } } | |
| end | |
| def words_random | |
| render json: { word: `shuf /usr/share/dict/words | head -1`.chomp } |
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
| express = require('express'); | |
| sqlite3 = require('sqlite3').verbose(); | |
| http = require('http'); | |
| exec = require('child_process').exec; | |
| db = new sqlite3.Database('/var/www/apps/shared/songs.db'); | |
| app = express(); | |
| app.listen(9999); |