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
RubyVM::InstructionSequence.compile_option = { | |
:tailcall_optimization => true, | |
:trace_instruction => false | |
} |
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
# Note Load (30.9ms) | |
SELECT "notes".*, ( | |
(ts_rank( | |
( | |
to_tsvector('english', unaccent( | |
coalesce("notes"."title"::text, '') | |
)) || to_tsvector('english', unaccent( | |
coalesce("notes"."short_text"::text, '') | |
)) |
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
~/dokku | |
total 56 | |
-rw-r--r-- 1 root root 732 Feb 23 18:36 AUTHORS | |
-rw-r--r-- 1 root root 738 Feb 23 18:36 bootstrap.sh | |
drwxr-xr-x 2 root root 4096 Feb 23 18:36 contrib | |
drwxr-xr-x 2 root root 4096 Feb 23 18:36 docs | |
-rwxr-xr-x 1 root root 3032 Feb 23 18:36 dokku | |
-rw-r--r-- 1 root root 845 Feb 23 18:36 HISTORY.md | |
-rw-r--r-- 1 root root 1055 Feb 23 18:36 LICENSE | |
-rw-r--r-- 1 root root 2072 Feb 23 18:36 Makefile |
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
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)] |
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
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 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
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 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 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 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
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 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
// 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 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
// 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 |