Skip to content

Instantly share code, notes, and snippets.

View sgvictorino's full-sized avatar

Solomon sgvictorino

  • /dev/random
View GitHub Profile
console.time("blocked"); (async () => Array(10).fill(1).forEach(() => require("crypto").randomBytes(512 * 10 ** 6)))(); console.timeLog("blocked");
@sgvictorino
sgvictorino / resetAllSequences.sql
Created June 6, 2019 22:38
Reset all the SQLite sequences.
delete from sqlite_sequence;
@sgvictorino
sgvictorino / datatable.ejs
Created June 4, 2019 03:45
Display all the properties of a JS object in a DataTable!
<table id="object_datatable" class="display">
<thead>
<tr>
<% Object.keys(dataList[0]).forEach(function(dataColumnName) { %>
<th><%= dataColumnName %></th>
<% }); %>
</tr>
</thead>
<tbody>
<% dataList.forEach(function(dataRow) { %>
@sgvictorino
sgvictorino / package.json
Last active May 30, 2019 21:08
my personal xo formatting config
"xo": {
"space": 4,
"semicolon": true,
"prettier": true,
"rules": {
"max-params": "off"
}
},
"prettier": {
"tabWidth": 4,
@sgvictorino
sgvictorino / count-failed-replies-udc.py
Last active May 29, 2019 00:24
My Pandorabots ultimate default case fallback count script.
# Created 4/11/19, 5:45 PM
import csv
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("-f", "--file", dest="filename",
help="read Pandorabots logs from FILE", metavar="FILE")
args = parser.parse_args()
log_filename = args.filename
@sgvictorino
sgvictorino / decimal2binary.js
Created September 18, 2018 19:52
Decimal to binary in JavaScript. Please note the following script file is licensed under the MIT license, written out in the license.txt file below.
// <start params block>
// This is the integer we'll convert to binary
var decimalValue = 11;
// <end params block>
// We'll divide by 2 in each iteration
const divisor = 2;
@sgvictorino
sgvictorino / binary2decimal.js
Last active September 18, 2018 19:52
Binary to decimal in JavaScript. Please note the following script file is licensed under the MIT license, written out in the license.txt file below.
// <start params block>
// This is the binary string we'll convert to decimal
var binaryValue = "1011";
// <end params block>
// A empty variable that will soon store the result of the computations
var decimalValue = 0;
@sgvictorino
sgvictorino / verifiedUserSearch.py
Created December 23, 2017 01:04
Find verified Twitter users from search query with python-twitter.
from twitter import Api
import keys
CONSUMER_KEY = keys.consumer_key #replace these...
CONSUMER_SECRET = keys.consumer_secret
ACCESS_TOKEN = keys.access_token_key
ACCESS_TOKEN_SECRET = keys.access_token_secret
api = Api(CONSUMER_KEY,
CONSUMER_SECRET,
ACCESS_TOKEN,
@sgvictorino
sgvictorino / README.txt
Last active September 25, 2016 19:17
Download the latest version of your open source software using a simple script.
Installation:
Step 1: Set up your software's homepage using an HTML5 a tag with the download attribute and no href attribute.
Step 2: In the root of your master branch, create a file called latest.txt that contains just one line: the latest release tag.
Step 3: After including the script in your page, call loadVersion() with all the parameters.
Step 4: Enjoy! The latest release's link will be served to your website, as long as you update latest.txt.
Breakdown of Parameters for loadVersion():
devname: The Github account name associated with the repository.
reponame: The name of the repository.
filename: The name of the downloadable file associated with all the current and future releases.
downloadlinkid: The HTML id of the download link on the website.