# Example 1 - Update current query's `tab` value
Starting URL: https://github.com/justsml?tab=repositories
Transform W/: {tab: 'activity'}
This file contains hidden or 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 emojiContainer = document.getElementById('custom_emoji'); | |
| const emojis = emojiContainer.querySelectorAll('tr.emoji_row'); | |
| const scrapped = Array.prototype.slice.call(emojis).map((row) => { | |
| const url = row.querySelector('span.emoji-wrapper').getAttribute('data-original'); | |
| const name = row.querySelector('[headers="custom_emoji_name"]').innerText; | |
| return { name, url }; | |
| }); | |
| console.log('total emojis: ', scrapped.length); | |
| console.log('data model: ', scrapped[Math.floor(Math.random() * scrapped.length)]); |
This file contains hidden or 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 EventEmitter = require('events'); | |
| class Eventry extends EventEmitter { | |
| constructor(type = 'none', ...args) { | |
| super(args); | |
| this.type = type; | |
| } | |
| // overload .on and .emit func to | |
| // support special event syntax | |
| on(ev, fn) { |
This file contains hidden or 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
| // transformy is an object mapping tool to | |
| // transform objects to another object defaults | |
| function extenze() { | |
| const args = Array.prototype.slice.call(arguments); | |
| const source = args.shift(); | |
| let current; | |
| while (current = args.shift()) { | |
| Object.keys(current).forEach((key) => { | |
| source[key] = typeof current[key] === 'object' |
This file contains hidden or 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 gulp = require('gulp'); | |
| const uglify = require('gulp-uglify'); | |
| const concat = require('gulp-concat'); | |
| // path prefix | |
| const prefix = 'assets/'; | |
| const vendorPrefix = `${prefix}src/vendor/`; | |
| const bowerPrefix = `${prefix}src/bower/`; | |
| const files = { |
This file contains hidden or 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
| javascript:!function(){function t(t,r){return t/r}function r(r,n){return t(r,n)*r}function n(){var n=window.prompt("Voltage?",4.2),o=window.prompt("Ohms?",.2);if(isNaN(n)&&(n=parseInt(n)),isNaN(o)&&(o=parseInt(o)),n&&o){var i="Stats:\r";i+="Amps: "+t(n,o).toFixed(2)+"\r",i+="Ohms: "+o+"\r",i+="Volts: "+n+"\r",i+="Watts: "+r(n,o).toFixed(2)+"\r",window.alert(i)}}n()}(); |
This file contains hidden or 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
| var request = require('request'), | |
| util = require('util'); | |
| function handleRequest(err, data) { | |
| if (err) throw new Error(err); | |
| if (data.statusCode == 200 || | |
| data.statusCode == 304) { | |
| var json = JSON.parse(data.body); | |
| return json.map(translateReq); | |
| } else { |
This file contains hidden or 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
| [user] | |
| email = john@smith.com | |
| name = John Smith | |
| [core] | |
| mergeoptions = --no-commit | |
| [alias] | |
| pff = pull --ff-only | |
| quick = log -1 --format='%h - %an - %ad - %s' --date=local --name-status | |
| squash = merge --squash | |
| blog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative |
This file contains hidden or 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
| var youTuber = (function(w,d,pub) { | |
| var priv = {}; | |
| var state = {}; | |
| state.links = {}; | |
| priv.findLinksInElem = function(elem) { | |
| var cur = {}; | |
| cur.href = elem.getAttribute('href'); | |
| cur.sessionlink = elem.getAttribute('data-sessionlink'); | |
| cur.title = elem.getAttribute('title'); |