Skip to content

Instantly share code, notes, and snippets.

View charliemday's full-sized avatar
🐛
Squashing

Charlie charliemday

🐛
Squashing
View GitHub Profile

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@charliemday
charliemday / opensea.py
Last active May 4, 2022 06:22
Scraping shenanigans
import os
import re
import argparse
# Thingdoms Eth Address
eth_address = "0x0aa7420c43b8c1a7b165d216948870c8ecfe1ee1"
# Command Line Arguments
ap = argparse.ArgumentParser()
ap.add_argument("-n", "--number", required=False,
@charliemday
charliemday / sql_print.js
Created March 17, 2022 12:18
Print TypeORM SQL with Variables
let [sql, params] = q.getQueryAndParameters();
params.forEach((value, index) => {
if (typeof value === 'string') {
sql = sql.replace(`$${index + 1}`, `'${value}'`);
}
if (typeof value === 'object') {
if (Array.isArray(value)) {
sql = sql.replace(
`$${index + 1}`,
def simple_function():
print('Hello World')
def simple_function():
print('Hello World')
var demoApp = createElement(
"div",
{
children: [
createElement("span", { children: "Hello" },
renderHtmlComponent),
createElement("span", { children: "React" }, renderHtmlComponent),
],
},
renderHtmlComponent
function renderHtmlComponent({ children }) {
// Returns children as an array
return Array.isArray(children) ? children : [children]
}
function createElement(elementType, props, render) {
// Initialise empty html string
let html = ""
// Add start of element
html += `<${elementType}>`
// Add children
html += render(props).join("")
// Add end of element
html += `</${elementType}>`
return html
<head>
<title>GlassBox - React</title>
</head>
<body>
<div id="glass-box-root"></div>
<script type="text/javascript" src="./index.js"></script>
</body>
function createElement(elementType, props, render) {
// Initialise empty html string
let html = ""
// Add start of element
html += `<${elementType}>`
// Add children
html += render(props).join("")
// Add end of element
html += `</${elementType}>`
return html