Skip to content

Instantly share code, notes, and snippets.

View electblake's full-sized avatar
🧙

Blake E electblake

🧙
View GitHub Profile
@guest271314
guest271314 / javascript_engines_and_runtimes.md
Last active July 15, 2024 05:57
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@matthughes
matthughes / md_slack.rb
Last active March 6, 2024 21:21 — forked from h6y3/md_slack.rb
Obsidian Markdown to Slack
#!/usr/bin/env ruby
# Read from stdin rather than file.
file_data = $stdin.read
# Upper case title
re = /^#* .+/
file_data.gsub!(re) { |match| "*#{match.upcase}*"}
# Mutate todos
@jscyo
jscyo / helper.js
Last active September 28, 2022 16:28
Helper functions for Auth0 to SuperTokens migration
let auth0Domain = "https://yourdomain.com"
let userIdMappingFile = "/userDataMapping.json"
let doesUserExistInAuth0DataBase = async (email, password) => {
let config = {
method: "post",
url: auth0Domain + "/oauth/token",
headers: {
@h6y3
h6y3 / md_slack.rb
Last active May 26, 2023 08:55
Obsidian Markdown to Slack
#!/usr/bin/env ruby
filename = "/Users/hyuan/Development/bin/tmp/tmp_slack_md.txt"
file = File.open(filename)
file_data = file.read
# Upper case title
re = /^#* .+/
file_data.gsub!(re) { |match| "*#{match.upcase}*"}
@kepano
kepano / obsidian-web-clipper.js
Last active July 16, 2024 14:14
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@wbern
wbern / bin.ts
Last active August 17, 2021 18:13
rush-changed-projects (some process.env vars might be org-specific)
import { getCommand } from "./lib";
import { printCommand } from "./util";
import process from "process";
function main() {
const [
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
__,
@statik
statik / waf.ts
Last active June 12, 2024 13:21
WAF with CDK examples
import * as cdk from "@aws-cdk/core";
import * as wafv2 from "@aws-cdk/aws-wafv2";
// This extends the base cdk stack properties to include a tag name input.
export interface StackProps extends cdk.StackProps {
tag: string;
applicationName?: string;
}
export class WAFStack extends cdk.Stack {
@apisandipas
apisandipas / De-quarantine an app on MacOS
Last active June 7, 2024 00:58
De-quarantine an app on MacOS
codesign --sign - --force --deep /Applications/VSCodium.app
xattr -d com.apple.quarantine /Applications/VSCodium.app
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active July 17, 2024 09:47
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@laggardkernel
laggardkernel / dynamic-umask-based-on-cwd.md
Last active April 14, 2024 06:30
Change umask based on working directory #zsh #direnv

Default umaks on macOS is 0077, which is different with most Linux distributions.

There're pros and cons about this very decision made by Apple. For the good part, temporary files generate under /tmp, $TMPDIR are accessible by the user himself only. These locations could be alternatives to $XDG_RUNTIME_DIR.

While, the problem is that since the new files are accessible by yourself only, it's inconvenient to share files with other users.

It's easy to change umask globally with a LauchAgent, or change it for shells