| id | name |
|---|---|
| 1 | Jane |
| 2 | Max |
| 3 | John |
| 4 | Scott |
| api: bundle exec puma -C config/puma.rb |
| 'use strict'; | |
| const fs = require('fs'); | |
| const expandHomeDir = require('expand-home-dir'); | |
| const zshHistoryRaw = fs.readFileSync(expandHomeDir('~/.zsh_history'), 'utf8'); | |
| const zshHistoryLines = zshHistoryRaw.split('\n'); | |
| const transformLine = line => { | |
| try { |
| // how_much_netflix.js | |
| // A script that looks through your Netflix viewing activity and | |
| // tallys up how much time you've spent watching Netflix | |
| // | |
| // INSTRUCTIONS TO USE: | |
| // Open https://www.netflix.com/WiViewingActivity and the developer console | |
| // Copy and paste this script into the developer console and press enter | |
| // | |
| (function() { | |
| var fetchAllViewedItems = function() { |
###Redux Egghead Video Notes###
####Introduction:#### Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.
Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.
####1st principle of Redux:#### Everything that changes in your application including the data and ui options is contained in a single object called the state tree
You got your hands on some data that was leaked from a social network and you want to help the poor people.
Luckily you know a government service to automatically block a list of credit cards.
The service is a little old school though and you have to upload a CSV file in the exact format. The upload fails if the CSV file contains invalid data.
The CSV files should have two columns, Name and Credit Card. Also, it must be named after the following pattern:
YYYYMMDD.csv.
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
| javascript: (function() { | |
| function getWatchCount() { | |
| var total = 0; | |
| var scopeIds = {}; | |
| angular.forEach( | |
| document.querySelectorAll( ".ng-scope , .ng-isolate-scope" ), | |
| countWatchersInNode |
| $enable_tracing = false | |
| #$trace_out = File.open(Rails.root + 'trace.txt', 'w') | |
| set_trace_func proc { |event, file, line, id, binding, classname| | |
| if $enable_tracing && event == 'call' | |
| #$trace_out.puts "#{file}:#{line} #{classname}##{id}" | |
| raise "crash me" if caller_locations.length > 500 | |
| end | |
| } |