Skip to content

Instantly share code, notes, and snippets.

View dataserver's full-sized avatar
💤
vacation

John dataserver

💤
vacation
View GitHub Profile
@dataserver
dataserver / exportSecretFromAuthy.md
Last active August 12, 2019 05:08
Exporting Secret code from Authy to other password managers
@dataserver
dataserver / closure-table-operations.sql
Created March 4, 2019 16:35 — forked from kentoj/closure-table-operations.sql
Closure Table operations SQL fragments
-- Retrieve descendants
-- ====================
-- retrieve descendants of #4
SELECT c.*
FROM Comments AS c
JOIN TreePaths AS t ON c.comment_id = t.descendant
WHERE t.ancestor = 4;
-- Retrieve ancestors
@dataserver
dataserver / populateForm.js
Created April 4, 2019 17:35
populate form from JSON
/**
* populate Form from JSON object data
*
* @param obj formEl Form node
* @param obj data JSON data
*/
function populateForm(formEl, data) {
Object.keys(data).map(function (key, index) {
let value = data[key];
let node_ctrl, field_tag;
@dataserver
dataserver / boleto.js
Created July 18, 2019 14:31
boleto js febraban
/**
* https://jsfiddle.net/3bcz5jav/5/
* required:
* - moment.js https://momentjs.com/
*/
var Boleto = {
barcodeNumber: '',
bankSlipNumber: '', // bankSlipNumber
errors: [],
@dataserver
dataserver / userscript.js
Last active March 5, 2024 12:08
tampermonkey userscript boilerplate
// ==UserScript==
// @name userscript boilerplate
// @namespace userscriptnamespace
// @version 1
// @description Script description
// @author Author
// @match http://asdf.com/*
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-popup-overlay/2.1.1/jquery.popupoverlay.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery.serializeJSON/2.9.0/jquery.serializejson.min.js
@dataserver
dataserver / delete_chrome_history.js
Created July 18, 2019 14:40
js delete chrome history
inputs = document.querySelectorAll("input")
inputs.forEach(i => {i.checked = true})
button = document.querySelector("#remove-selected");
button.disabled = false;
button.click()
alertOverlayOk.click()
// OR
var inputs = document.getElementsByTagName('input');
@dataserver
dataserver / youtube2mp3.py
Created July 18, 2019 16:27
python to download youtbe music as mp3
# require
# https://ffmpeg.org/download.html
# to convert to .mp3
from __future__ import unicode_literals
import youtube_dl
class MyLogger(object):
def debug(self, msg):
pass
@dataserver
dataserver / gist:dde1e39d507d7498c6a4c8abbdc1955f
Last active July 21, 2019 02:37
to create a bookmarklet to watch LIVE jp tv on youtube
var pad = function (number, digits) {
return Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number;
};
var d = new Date();
var utc = d.getTime() + (d.getTimezoneOffset() * 60000);
var offset = 9;
var nd = new Date(utc + (3600000 * offset));
var year = nd.getFullYear(),
month = pad(nd.getMonth() + 1, 2),
day = pad(nd.getDate(), 2);
@dataserver
dataserver / html-select-month-day-year.html
Created August 10, 2019 23:16
html select month day year
<span>
<select name="month">
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
@dataserver
dataserver / gui.ui
Last active August 10, 2019 23:38
youtube-dl gui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>454</width>
<height>507</height>