Skip to content

Instantly share code, notes, and snippets.

View MarketingPip's full-sized avatar
🚬
🌳

Jared Van Valkengoed MarketingPip

🚬
🌳
View GitHub Profile
[
{
"verseref": "Genesis 1:27–28Aa",
"content": "So <strong>God </strong>created man <strong>in his own image</strong>, in the <strong>image of God</strong> he created him; male and female he created them. And God blessed them."
},
{
"verseref": "Genesis 28:22b",
"content": "And of all that <strong>You</strong> give me I will give a full tenth to <strong>You</strong>."
},
{
@vimagick
vimagick / imdb-top-1000.tsv
Last active May 24, 2024 09:32
IMDB Top 1000 (2024-05-24)
id title year rating votes genres
tt0111161 The Shawshank Redemption 1994 9.3 2898037 Drama
tt0068646 The Godfather 1972 9.2 2019075 Crime,Drama
tt0468569 The Dark Knight 2008 9 2879307 Action,Crime,Drama
tt0167260 The Lord of the Rings: The Return of the King 2003 9 1984683 Action,Adventure,Drama
tt0108052 Schindler's List 1993 9 1455136 Biography,Drama,History
tt0071562 The Godfather Part II 1974 9 1367888 Crime,Drama
tt0050083 12 Angry Men 1957 9 868247 Crime,Drama
tt0110912 Pulp Fiction 1994 8.9 2226994 Crime,Drama
tt0120737 The Lord of the Rings: The Fellowship of the Ring 2001 8.9 2012887 Action,Adventure,Drama
@alwinchan
alwinchan / error-detection.js
Last active March 23, 2024 10:26
Use html2canvas to capture a screenshot of the page upon any errors in the console via window.onerror event and send it to Slack as alert/notification. Image are stored with imgbb.com
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = '//html2canvas.hertzen.com/dist/html2canvas.min.js';
document.head.appendChild(script);
window.onerror = async function () {
const { 0: errorMessage, 1: fileName, 2: lineNumber, 3: columnNumber, 4: errorObj } = arguments;
if (typeof html2canvas === 'function') {
html2canvas(document.body, { scale: 1.0 }).then(async (canvas) => {
const base64image = canvas.toDataURL('image/png');
let imageData = base64image.split('base64,');
@pocco81
pocco81 / os.capture
Created September 15, 2021 03:12 — forked from dukeofgaming/os.capture
Capture console output from Lua system call
---
-- Function to retrieve console output
--
function os.capture(cmd, raw)
local handle = assert(io.popen(cmd, 'r'))
local output = assert(handle:read('*a'))
handle:close()
if raw then
@ritwickdey
ritwickdey / infinite-loop-detection.js
Last active November 21, 2023 12:54
Infinite loop detection via AST transformation
export default function (babel) {
const { types: t } = babel;
const infiniteLoopDetector = babel.parse(`
function __infiniteLoopDetector() {
loopdetector.count += 1;
if(loopdetector.count > 10000) {
throw new Error("Infinte loop detected.")
@mob-sakai
mob-sakai / _README.md
Last active May 8, 2024 08:10
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
@napsternxg
napsternxg / wikidata_subclass.sparql
Created July 14, 2020 05:08
Wikidata get all subclasses of a given class
SELECT ?subClass ?subClassLabel ?desc WHERE {
?subClass wdt:P279* wd:Q5. # Here we are getting all subClasses of Human and its subclasses
OPTIONAL {
?subClass rdfs:label ?desc.
FILTER((LANG(?desc)) = "en")
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
@soraxas
soraxas / SurfingKeys.js
Last active November 3, 2023 21:09
SurfingKeys settings (vim keybindings for browser)
// git.io url: https://tinyurl.com/SurfingKeys-settings or https://git.io/JfXjB
// inspired by https://github.com/Foldex/surfingkeys-config/blob/master/config.js
// remove conflict with browser's history, download pannel toggle
// unmap('<Ctrl-j>');
// iunmap('<Ctrl-j>');
// vunmap('<Ctrl-j>');
// unmap('<Ctrl-h>');
// iunmap('<Ctrl-h>');
// vunmap('<Ctrl-h>');
@atamaniuc
atamaniuc / remove-array-multi-dem-duplicates.js
Created May 8, 2020 14:14
Removing Duplicate Arrays from an Array of Arrays
let bigArray = [["a", "b", "c"],
[1, 2, 3],
[true, true, false],
[":)", ":P", ":X"],
[true, false, false],
[1, 2, 3],
["foo", "zorb", "blarg"],
["a", "b", "c"]];
let uniqueArray = Array.from(new Set(bigArray.map(JSON.stringify)), JSON.parse);