Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry session
Debugger
{"id":0,"name":"Bitcoin","owner":"0xc0F030eac8b588817f8dA16b9a2CDCcc6451B25c"} | |
{"id":1,"name":"Trump","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"} | |
{"id":2,"name":"King","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"} | |
{"id":3,"name":"Joe","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"} | |
{"id":4,"name":"china","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"} | |
{"id":5,"name":"usa","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"} | |
{"id":6,"name":"love","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"} | |
{"id":7,"name":"covid19","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"} | |
{"id":8,"name":"Obama","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"} | |
{"id":9,"name":"buterin","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"} |
# space150 vine-to-GIF | |
# given a vine.co uri, downloads the MP4 and creates an image sequence / GIF from it | |
# requires ruby, ffmpeg, and imagemagick | |
require 'open-uri' | |
require 'nokogiri' | |
id = ARGV[0] | |
# try to convert from URL to id. |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
class MyClass | |
# All of these are equivalent | |
def self.myMethod | |
true | |
end | |
def MyClass.myMethod | |
true | |
end |
# first: mkdir user && cd user && cp /path/to/get_gists.py . | |
# python3 get_gists.py user | |
import requests | |
import sys | |
from subprocess import call | |
user = sys.argv[1] | |
r = requests.get('https://api.github.com/users/{0}/gists'.format(user)) |
(function() { | |
var k, aa = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, b, c) { | |
if (c.get || c.set) throw new TypeError("ES3 does not support getters and setters."); | |
a != Array.prototype && a != Object.prototype && (a[b] = c.value) | |
}, | |
ba = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : this, | |
ca = function(a, b) { | |
if (b) { | |
for (var c = ba, d = a.split("."), e = 0; e < d.length - 1; e++) { | |
var f = d[e]; |
// http://www.barbarianmeetscoding.com/blog/2016/04/27/a-look-at-es6-maps/ | |
const wizardsArchive = new Map(); | |
wizardsArchive.set('jaime', { | |
name: 'jaime', | |
title: 'The Bold', | |
race: 'ewok', | |
traits: ['joyful', 'hairless'] |
ECMAScript 6, also known as ECMAScript 2015, is the latest version of the ECMAScript standard. ES6 is a significant update to the language, and the first update to the language since ES5 was standardized in 2009. Implementation of these features in major JavaScript engines is underway now.
See the ES6 standard for full specification of the ECMAScript 6 language.
ES6 includes the following new features: