Skip to content

Instantly share code, notes, and snippets.

View nataliemarleny's full-sized avatar
🧠
Thinking about thinking

Natalie Marleny nataliemarleny

🧠
Thinking about thinking
View GitHub Profile
@nataliemarleny
nataliemarleny / .gitconfig
Last active October 19, 2021 09:50
Niche git commands which I won't remember aliases for
[user]
name = <ur-name>
email = <ur-email>
[core]
editor = vim -f
excludesfile = /Users/<name-of-mac>/.gitignore_global
[color]
ui = true
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset' --abbrev-commit
@nataliemarleny
nataliemarleny / minimal-javascript-gitignore
Last active July 15, 2021 11:06
Minimal .gitignore file for a Javascript sandbox
# JavaScript
node_modules
.next
# Mac
.DS_Store
@nataliemarleny
nataliemarleny / Fetch-and-reset-latest-changes-in-multiple-repositories.sh
Last active January 8, 2021 12:18
Fetch and reset latest changes in multiple repositories
for f in $(ls); do
cd $f && git fetch --prune origin && git reset --hard origin/$main_branch_name && cd -;
done
const fs = require("fs");
// "4\n1\n2\n5\n3"
const input = fs.readFileSync(0).toString();
// [4, 1, 2, 5, 3]
const lines = input.split("\n").map((n) => parseInt(n, 10));
const T = parseInt(lines[0], 10);
@nataliemarleny
nataliemarleny / structured_var_dump.php
Last active July 11, 2020 10:22
Generalised structured var dump for php
function structured_var_dump($arr) {
return '<pre>' . var_export($arr, true) . '</pre>';
}
@nataliemarleny
nataliemarleny / structured_var_dump.php
Created July 11, 2020 10:20
Generalised structured var dump for php
function structured_var_dump($arr) {
return '<pre>' . var_export($arr, true) . '</pre>';
}
@nataliemarleny
nataliemarleny / sizeOfStringInUrl.sh
Created April 7, 2019 11:50
Script to evaluate the percentage of the size of a pattern in the JavaScript files of a given url
#!/usr/bin/env bash
set -eu -o pipefail
# Script expects these binaries to be present:
# - wget
# - node
# Tested on Mac.
# Example:
#
# bash sizeOfStringInUrl.sh nextjs.org "\bcreateElement\b"
@nataliemarleny
nataliemarleny / parseAlgos.js
Created June 1, 2020 12:53
Read input text file for completing algos (Node.js)
const fs = require('fs');
const input = fs.readFileSync(0).toString();
@nataliemarleny
nataliemarleny / settings.json
Last active May 22, 2020 10:01
[WIP] VSCode Settings.json
{
"editor.renderWhitespace": "boundary",
"workbench.colorTheme": "Framer Syntax",
"workbench.editor.tabSizing": "shrink",
"window.zoomLevel": 3,
"explorer.confirmDragAndDrop": false,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"workbench.sideBar.location": "right",
"editor.tabSize": 2,
@nataliemarleny
nataliemarleny / bisect.sh
Created December 9, 2019 17:18
Predicate Script for git bisect
#!/usr/bin/env bash
git clean -fxd
cd <package-name>
yarn
2>&1 yarn lint | grep -vq error