Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Otto thedanotto

View GitHub Profile
@thedanotto
thedanotto / es6.md
Last active Nov 5, 2018
es6 cheatsheet
View es6.md

Fat Arrow

function definition

let timesTwo = params => params * 2

// or

let timesTwo = params => {
  return params * 2;
View latlng-search.json
https://api.yelp.com/v3/businesses/search?term=food&latitude=40.754766&longitude=-73.916454&radius=50&price=1,2,3,4
{
"total": 2,
"businesses": [
{
"review_count": 196,
"phone": "+17182551349",
"rating": 4,
"id": "homemade-taqueria-long-island-city",
View location-search.json
https://api.yelp.com/v3/businesses/search?term=food&location=45-09+34th+Ave+Long+Island+City+ny+11101&radius=50&price=1,2,3,4
{
"businesses": [
{
"name": "The Alcove",
"coordinates": {
"latitude": 40.7460048214421,
"longitude": -73.9152161277393
},
View vim.rb
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '7.3.515'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
View phoenix_application_heroku_error
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_ENV=production
View gist:ee6cbbe9074640f50e30
# make sure you have mongodb installed
brew install mongodb
# in your first terminal tab you need to start mongodb... so run the following command in terminal
mongod
#open a second terminal tab
rails new mongo_test --skip-active-record
cd mongo_test
View christmas_tree.rb
# christmas tree is 7 layers tall
# it is 11 asterix wide
# how many spaces is an asterix? Each asterix is one space
# Special features
# number of rows 1 - 10
# if a tree is 3 rows...
# *
# ***
# *****
# formula for number of asterix.... is ... rows * 2 - 1
You can’t perform that action at this time.