This file contains 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
if (!MouseEvent.prototype.hasOwnProperty('buttons')) { | |
let mousedown = 0; | |
addEventListener('mousedown', e => mousedown = e.button || 1); | |
addEventListener('mouseup', () => mousedown = 0); | |
Object.defineProperty(MouseEvent.prototype, 'buttons', { | |
get () { | |
return mousedown; | |
} |
This file contains 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
'use strict'; | |
if (!document.elementsFromPoint) { | |
document.elementsFromPoint = elementsFromPoint; | |
} | |
function elementsFromPoint(x, y) { | |
var parents = []; | |
var parent = void 0; | |
do { |
This file contains 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
const sent = require('./sent.js'); | |
const nodemailer = require('nodemailer'); | |
const PEOPLE = require('./people.js').filter(person => person.Approval === 1).filter(person => !sent.includes(person.Email)); | |
// const PEOPLE = [{ | |
// Email: '[email protected]', | |
// 'Full Name': 'Iddan Aharonson' | |
// }]; | |
This file contains 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
module.exports = { | |
entry: './index.js', | |
module: { | |
loaders: [ | |
{ | |
test: /.js$/, | |
loader: 'babel' | |
} |
This file contains 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
function* evaluateElement (el, xpath) { | |
let evaluation = document.evaluate(xpath, el); | |
let iterated; | |
while (iterated = evaluation.iterateNext()) { | |
yield iterated; | |
} | |
} |
This file contains 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
export default class ID extends String { | |
constructor () { | |
super(Math.random().toString(36).slice(2)); | |
} | |
} |
This file contains 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
/^\d\d\d\d(?:(?:0[1-9])|(?:1[0-2]))((?:[0-2]\d)|(?:3[01]))$/ |
This file contains 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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import store from './store'; | |
import Toolbox from './toolbox'; | |
import Feed from './gallery'; | |
import Chat from './chat'; | |
function App () { | |
return ( |
This file contains 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
/** | |
* Insert documents to a document collection with unique ids. Override if exists. | |
* @param {array} state | |
* @param {array} newState | |
* @param {string} id | |
*/ | |
function insert(state, newState, id) { | |
let ids = newState.reduce((ids, item) => ({ ...ids, [item[id]]: true }), {}); | |
return [...state.filter(item => !ids[item[id]]), ...newState]; | |
} |
This file contains 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
// open Chrome Dev Tools | |
// go to the network tab | |
// open Instagram.com/:profile | |
// scroll until all the request images are displayed | |
// right click on one of the names to the left under the graph. | |
// choose "Save as HAR with content" | |
// save it as log.json | |
const extractMatch = (string, regexp, index) => | |
string.match(regexp) && string.match(regexp)[index]; |
OlderNewer