Skip to content

Instantly share code, notes, and snippets.

@Log-of-e
Log-of-e / gist:6b0d20ecc46e4530027e91abb34b91e8
Created October 16, 2025 20:20
Javascript Typed Arrays and ArrayBuffer
//Int32 array in Javascript
const mem00=new ArrayBuffer(16);
let ui8=new Uint8Array(mem00);
let ui16=new Uint16Array(mem00);
@Log-of-e
Log-of-e / copyTranscript.js
Last active August 13, 2025 02:05
youtube transcript copy bookmarklet
(function() {
const showTranscriptButton = Array.from(document.querySelectorAll('button')).find(el => el.textContent.includes('Show transcript'));
if (!showTranscriptButton) {
confirm('Could not find the "Show transcript" button.');
return;
} else {
}
showTranscriptButton.click();
@Log-of-e
Log-of-e / select-tech-parameters
Last active November 6, 2023 23:09
Selecting Tech Parameters
When selecting between options to achieve a technical goal these are the parameters to consider.
- Integration with current stack
- easy to use: ease of implementation, updates, settings
- speed
- capabilities or match with requirements
- cost
- platform independent
@Log-of-e
Log-of-e / pubpubapi.py
Last active August 3, 2023 20:00
PubPub API with Python
import requests
import json
from Crypto.Hash import keccak
class Pubshelper:
def __init__(self, community_url="https://unjournal.pubpub.org", community_id="d28e8e57-7f59-486b-9395-b548158a27d6", email='revwr@gmail.com',password = '8paswortt' ):
self.community_url = community_url
self.community_id = community_id
self.cookieJar = None
self.logged_in = False
@Log-of-e
Log-of-e / admin01.cql
Created December 31, 2021 19:03
Find version of Neo4j DB running
// find the version of Neo4j DB running
call dbms.components()
// sample output:
// +------------------------------------------+
// | name | versions | edition |
// +------------------------------------------+
// | "Neo4j Kernel" | ["4.0.4"] | "community" |
'clear python 2 and 3 cli'
'this method does not clear, but adds empty space above'
print("\n" * 80)
'real terminal clear'
import os
os.system('clear')
@Log-of-e
Log-of-e / StoreHelpers.js
Created July 3, 2020 16:34
Clone and merge JS objects
//code written by Sham Bhangal, Senior Web application developer
// https://www.quora.com/profile/Sham-Bhangal
// on site: https://www.quora.com/Vue-js-seems-to-be-much-more-productive-than-React-js-Why-do-some-still-use-React
class StoreHelpers {
static deepClone(obj) {
var out, v, key;
out = Array.isArray(obj) ? [] : {};
for (key in obj) {
@Log-of-e
Log-of-e / git-recover-branch.md
Created February 26, 2019 03:32 — forked from jbgo/git-recover-branch.md
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@Log-of-e
Log-of-e / gist:18ef17a82517ebf7bb812e4b880a2438
Created March 9, 2018 22:21 — forked from rmondello/gist:b933231b1fcc83a7db0b
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

This is the process I used to create a CSV file of his credentials in the format “example.com,user,pass”. This portable format would be pretty easy to import into 1Password or Safari in the future.

The way I went about this isn’t great; it opens up more opportunities for apps to control one’s Mac through Accessibility APIs, it writes plaintext passwords to disk, and it could use some cleaning up. A better approach might leverage the security command line tool that ships with OS X. That said, I found this method to be a fun illustration of what’s possible us

@Log-of-e
Log-of-e / js_hoist_order.js
Last active November 27, 2017 17:30
JS javascript Hoisting precedenc
function afirst(a,b){
console.log(`
***\n
***hoist precednece:\n
1.function declaration
2.function args
3.var declaration, cannot overwrite no.1 function dec
`)
}