Skip to content

Instantly share code, notes, and snippets.

@mryellow
mryellow / gist:6b81ad26575d464521edcd6a5fb1dca0
Last active May 19, 2020 03:08
Remove SBL from Youtube
// ==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==
// ==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==
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);}});
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();
// ==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 February 6, 2017 23:56
Delete indexedDB databases bookmarklet
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 July 30, 2016 06:06
CircleCI Jekyll Github pages
general:
branches:
only:
- production
deployment:
production:
branch: production
commands:
- git config --global user.name "${CIRCLE_PROJECT_USERNAME}"
/**
* 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 22:49
KnockoutJS binding handlers
/**
* 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);
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]*$/;