This file contains 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
bolt create my_first_site | |
** Starting Bolt... | |
/home/rory/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- test/unit/ui/console/testrunner (LoadError) | |
from /home/rory/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' | |
from /home/rory/.rvm/gems/ruby-1.9.3-p194/gems/bolt-0.2.15/lib/bolt/runners/test_unit.rb:2:in `<top (required)>' | |
from /home/rory/.rvm/gems/ruby-1.9.3-p194/gems/bolt-0.2.15/lib/bolt/runner.rb:35:in `runner' | |
from /home/rory/.rvm/gems/ruby-1.9.3-p194/gems/bolt-0.2.15/lib/bolt/runner.rb:13:in `initialize' | |
from /home/rory/.rvm/gems/ruby-1.9.3-p194/gems/bolt-0.2.15/lib/bolt/listener.rb:24:in `new' | |
from /home/rory/.rvm/gems/ruby-1.9.3-p194/gems/bolt-0.2.15/lib/bolt/listener.rb:24:in `initialize' | |
from /home/rory/.rvm/gems/ruby-1.9.3-p194/gems/bolt-0.2.15/lib/bolt.rb:85:in `new' |
This file contains 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
def lrgst(a) | |
largest = 0 | |
a.each {|i| largest = i if i > largest } | |
largest | |
end | |
def radix_lsd(uns) | |
sorted = (0..Math.log10(lrgst(uns)).floor).inject(uns) do |memo, index| | |
groups = Array.new(10).map{|x| [] } | |
memo.each { |u| groups[(u / 10**index) % 10] << u } |
This file contains 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
def get_current_num(): | |
f = open("statement", "r") | |
num = int(f.read()) | |
f.close() | |
return num | |
def write_new_num(n): | |
f = open("statement", "w") | |
stmt_string = str(n) | |
f.write(stmt_string) |
This file contains 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
// set the date we're counting down to | |
var target_date = new Date("Aug 15, 2019").getTime(); | |
// variables for time units | |
var days, hours, minutes, seconds; | |
// get tag element | |
var countdown = document.getElementById("countdown"); | |
// update the tag with id "countdown" every 1 second |
This file contains 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
// Sass and css libs | |
gulp.task('css', function () { | |
var sassStream = gulp.src('./assets/*.scss').pipe(sass()); | |
var cssFiles = gulp.src('./assets/csslib/*.css'); | |
var queue = new StreamQueue(); | |
queue.queue( | |
cssFiles, | |
sassStream | |
); |
This file contains 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
DB ORM Lang | |
MongoDB(ok but no joins) + Mongoose(Great) + Node.js(Great) | |
Postgres(ok but schemas) + Sequelize(Great) + Node.js(Great) | |
RethinkDB(Great) + Thinky(ok but no validations) + Node.js(Great) | |
RethinkDB(Great) + nobrainer(Great) + Ruby(Good but already started app in Node.js and a little slow) |
This file contains 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 gulp = require('gulp'); | |
var jshint = require('gulp-jshint'); | |
var stylish = require('jshint-stylish'); | |
var concat = require('gulp-concat'); | |
var rename = require('gulp-rename'); | |
// var uglify = require('gulp-uglify'); | |
var nodemon = require('gulp-nodemon'); | |
var sass = require('gulp-sass'); | |
var StreamQueue = require('streamqueue'); |
This file contains 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
import math | |
def is_whole(x): | |
return x % 1 == 0 | |
n = int(raw_input()) | |
c_list = set() | |
c = 5 | |
while len(c_list) < n: |
This file contains 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
n = int(raw_input()) | |
a = [ int(raw_input()) for x in range(n) ] | |
average_count = 0 | |
for (i, el) in enumerate(a): | |
a.pop(i) # remove that element | |
for to_avg_with in a: | |
avg = (el + to_avg_with) / 2 | |
if avg in a: | |
average_count += 1 |
This file contains 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
room_count = int(raw_input()) | |
def tb(x): | |
return x == "*" | |
def get_room_in_bools(): | |
height, width = [ int(y) for y in raw_input().split(" ") ] | |
return [ [ tb(x) for x in list(raw_input()) ] for y_axis in xrange(0, height) ] | |
room_grids = [get_room_in_bools() for x in xrange(0, room_count)] |
OlderNewer