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
| CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline`" rbenv install 2.3.0 |
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
| select | |
| week_day | |
| from | |
| course_classes | |
| order by | |
| ((week_day + 2) % 7) -- where 2 is the current wday | |
| ; | |
| week_day | |
| ---------- |
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 a = [0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 6] | |
| var wday = 3; | |
| console.log('wday', wday); | |
| for (var i = 0; i < a.length; i++) { | |
| console.log('i',((a[i] + wday) % 7)); | |
| } | |
| /* |
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
| <div id="container"> | |
| <div id="clock"> | |
| 19:03 | |
| </div> | |
| </div> |
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
| { | |
| "parser": "babel-eslint", | |
| "env": { | |
| "browser": true, | |
| "node": true | |
| }, | |
| "plugins": [ | |
| "react" |
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
| def dicty(n): | |
| d = {} | |
| for i, elem in enumerate(range(1,n + 1)): | |
| d[elem] = n - i | |
| return d | |
| print dicty(5) # => {1: 5, 2: 4, 3: 3, 4: 2, 5: 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
| var pg = require('pg'); | |
| var c = require('./config'); | |
| var db = (function db() { | |
| 'use strict'; | |
| var cnxStr = `postgres://${c.db.user}:${c.db.password}@${c.db.host}/${c.db.database}` | |
| function query(sql, params) { |
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 db = require('./db'); | |
| db.query('select * from users').then(function (d){ | |
| console.log('hi', d); | |
| }, function (data) { | |
| console.log('a', data); | |
| }); | |
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
| <div class="layout"> | |
| <div class="nav col"> | |
| <h3>Menu</h3> | |
| <ul> | |
| <li><a href="#">Home</a></li> | |
| <li><a href="#">About</a></li> | |
| <li><a href="#">Contact</a></li> | |
| </ul> | |
| </div> | |
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
| simple = -> (s) { puts s.chars.join(" ").upcase, s.chars[1..-1].join("\n").upcase } | |
| overcomplicate = -> (s) { [[s.chars.map{|c| c + ' '}.join], s.chars[1..-1]].each { |s| puts s.join("\n").upcase } } | |
| simple["sire"] | |
| overcomplicate["sire"] | |