Skip to content

Instantly share code, notes, and snippets.

"build:minify": "minify --recursive --output dist dist",
"build:vendor-size-check": "chalk blue bold 'Vendor Libs Size Check:\n\n' && bundlesize -f \"dist/js/web_modules/**/*.js\" -s 35kB",
"build:total-size-check": "ncat 'dist/**/*.js' -o ./total-bundle.js > /dev/null && chalk blue bold 'Total JS Size Check:\n\n' && bundlesize -f ./total-bundle.js -s 70kB && trash ./total-bundle.js",
@Darkle
Darkle / .js
Created March 9, 2020 00:08
Things that are broken in lightscripts syntax highlighting
pathname.match(/\//gu).length === 1
@Darkle
Darkle / img.json
Created February 23, 2020 00:37
Example image json
{
"kind": "t3",
"data": {
"approved_at_utc": null,
"subreddit": "redpandas",
"selftext": "",
"author_fullname": "t2_3yo62",
"saved": false,
"mod_reason_title": null,
"gilded": 0,
@Darkle
Darkle / .sh
Last active February 21, 2020 01:28
cloneinside_func() {
node -p '
var repoUrl = "'"$1"'";
repoUrl = repoUrl.slice(0,-4) + "/archive/master.zip";
if(repoUrl.startsWith("git@github.com:")){
repoUrl = "https://github.com/" + repoUrl.slice(15)
};
var spawn = require("child_process").spawn;
spawn("wget " + repoUrl,{ stdio: "inherit", shell: true });' > /dev/null 2>&1
unzip -n ./master.zip -d ./cloneinside-tmp
@Darkle
Darkle / winterm-callout.ahk
Last active January 13, 2020 05:32 — forked from wizcas/winterm-callout.ahk
AHK Script for Calling Out Windows Terminal
; The path to the Windows Terminal exe file.
WtPath = "%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe"
^space::ToggleTerminal()
ShowAndPositionTerminal()
{
ScreenX := GetScreenLeft()
ScreenY := GetScreenBottom()
ScreenWidth := GetScreenWidth()
@Darkle
Darkle / index.ts
Last active November 24, 2019 23:34
My TypeScript FP Utility Functions
const noop = (): void => {}
const identity = <T>(param: T): T => param
const pipe = (...fns: Function[]): Function => (param: any) => fns.reduce((result, fn) => fn(result), param)
const compose = (...fns: Function[]): Function => (param: any) => fns.reduceRight((acc, current) => current(acc), param)
const curry = (f: Function): Function => (...a: any[]) => (...b: any[]) => f(...a, ...b)
@Darkle
Darkle / gist:41b6f3bdae48d2729942fb98d550a2b8
Last active November 9, 2019 07:03
enabling networking in ubuntu when network manager is disabled
https://www.configserverfirewall.com/ubuntu-linux/ubuntu-network-manager/
https://www.configserverfirewall.com/ubuntu-linux/configure-ubuntu-server-static-ip-address/
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo systemctl mask NetworkManager
sudo systemctl unmask systemd-networkd.service
sudo systemctl enable systemd-networkd.service
sudo systemctl start systemd-networkd.service
Add the interface configuration to the netplan config file (in the /etc/netplan directory):
make sure that the renderer is renderer: networkd
[ignore]
; We fork some components by platform
.*/*[.]android.js
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/
; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
main {
max-width: 70ch;
padding: 2ch;
margin: auto;
}
/*
https://jrl.ninja/etc/1/
https://www.reddit.com/r/css/comments/bb73cw/58_bytes_of_css_to_look_great_nearly_everywhere/ekj8yhm/?st=jvk78znl&sh=5221a2c0
*/
fetch('/foo')
.then(raiseErrorOnBadResponse)
.catch(logError)
// or maybe i could wrap fetch and throw an error when not a 200 response
netReq('/foo')
.catch(logErrror)