Skip to content

Instantly share code, notes, and snippets.

View brossetti1's full-sized avatar

Brian Rossetti brossetti1

View GitHub Profile
@brossetti1
brossetti1 / Named Hashmasks
Created March 8, 2021 18:04 — forked from yuradmt/Named Hashmasks
Hashmasks - named NFTs
{"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"}
@brossetti1
brossetti1 / vin_to_gif.rb
Created March 7, 2021 04:09 — forked from seyhunak/vin_to_gif.rb
Vine MP4 to GIF Converting using Ruby
# 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.

Pry Cheat Sheet

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

@brossetti1
brossetti1 / gist:2dc6b5a4e8f83cb8d07610a6292a7864
Created April 7, 2019 22:06 — forked from jeromedalbert/gist:5332994
The different ways to define class methods in Ruby.
class MyClass
# All of these are equivalent
def self.myMethod
true
end
def MyClass.myMethod
true
end
@brossetti1
brossetti1 / get_gists.py
Created January 23, 2019 01:26 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
# 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))
@brossetti1
brossetti1 / README.md
Created August 7, 2018 10:36 — forked from hofmannsven/README.md
My simply Git Cheatsheet
(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 git.io/es6features

Introduction

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:

Bisecting

First you start the bisect

git bisect start

Then you mark good and bad refs

git bisect good v2.6.18

git bisect bad master