Skip to content

Instantly share code, notes, and snippets.

View gist:6b81ad26575d464521edcd6a5fb1dca0
// ==UserScript==
// @name Remove SBL from Youtube
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Remove click-bait from your bass world!
// @author Mr-Yellow
// @match https://www.youtube.com/*
// @grant none
// @require http://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==
View youtube-un-sbl.js
// ==UserScript==
// @name Youtube Un-SBL
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Remove click-bait from your bass world!
// @author Mr-Yellow
// @match https://www.youtube.com/*
// @grant none
// @require http://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==
View evm_increaseTime_oneLine.js
web3.currentProvider.sendAsync({jsonrpc: '2.0',method: 'evm_increaseTime',params: [1000],id: Date.now()},err1 => {if (!err1) {web3.currentProvider.sendAsync({jsonrpc: '2.0',method: 'evm_mine',id: Date.now() + 1}, (err,res)=>console.log);}});
View asyncTxPriorityQueue.js
const Tx = require('ethereumjs-tx');
const asyncPriorityQueue = require('async').priorityQueue;
let web3;
let mutexLock = false;
const signTask = task => {
const tx = new Tx(task.txOpt);
tx.sign(Buffer.from(task.privateKey.replace(/^0x/, ''), 'hex'));
const valid = tx.validate();
View gist:94b796c7a448ddcec7d8f4ff9e0e45c6
// ==UserScript==
// @name Hide Facebook comments
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Improve self!
// @author Mr-Yellow
// @match https://www.facebook.com/
// @grant none
// ==/UserScript==
@mryellow
mryellow / gist:e4352664c4bc1fafd9932018b087ca90
Created Feb 6, 2017
Delete indexedDB databases bookmarklet
View gist:e4352664c4bc1fafd9932018b087ca90
javascript:indexedDB.webkitGetDatabaseNames().onsuccess = function (sender) { for (var x in sender.target.result) { console.log('Delete: ' + x); indexedDB.deleteDatabase(sender.target.result[x]); } }
@mryellow
mryellow / circle.yml
Last active Jul 30, 2016
CircleCI Jekyll Github pages
View circle.yml
general:
branches:
only:
- production
deployment:
production:
branch: production
commands:
- git config --global user.name "${CIRCLE_PROJECT_USERNAME}"
View gist:7fa748a3ba2134b5c834
/**
* Convert base.
*
* @param string number
* @param string fromBase
* @param string toBase
*
* @return string|integer
*/
var convBase = function(number, fromBase, toBase) {
@mryellow
mryellow / gist:6b2bf67e91d91f54d250
Created May 27, 2015
KnockoutJS binding handlers
View gist:6b2bf67e91d91f54d250
/**
* KnockoutJS Binding handler to select from array correct index based on stored key.
* This allows a model with `model_id` set to properly select the correct option after binding, when they become available.
*/
ko.bindingHandlers.optionsSelect = {
init: function(element, valueAccessor, allBindingsAccessor, deprecated, bindingContext) {
//console.log('optionsSelect: ', ko.unwrap(valueAccessor()), ko.unwrap(allBindingsAccessor()), bindingContext);
var input = ko.unwrap(valueAccessor().input);
var output = ko.unwrap(valueAccessor().output);
var condition = ko.unwrap(valueAccessor().condition);
View gist:cc2a9a677775877b5fd4
define(['durandal/app', 'plugins/observable', 'knockout', 'ko-validation'], function (app, observable, ko) {
/*jshint -W069 */
ko.validation.rules['password'] = {
validator: function (val, flag) {
//console.log('val', ModelUserSettings.auth);
//if (ModelUserSettings && ModelUserSettings.auth) return true;
if (ko.validation.utils.isEmptyVal(val)) return false;
var patt = /^[-+\sa-zA-Z0-9]*$/;