Skip to content

Instantly share code, notes, and snippets.

View onion2k's full-sized avatar
💭
In your browser, making it do stuff.

Chris Neale onion2k

💭
In your browser, making it do stuff.
View GitHub Profile
@onion2k
onion2k / git-prune.md
Created September 16, 2019 09:49
Prune local git branches

#Delete all local branches that aren't on remote.

##safe

git branch -vv | grep 'origin/.\*: gone]' | awk '{print \$1}' | xargs git branch -d

##unsafe - force delete

git branch -vv | grep 'origin/.\*: gone]' | awk '{print \$1}' | xargs git branch -D

const licenses = require('./licenses.json')
const packages = require('./packages.json')
lmap = {}
Object.entries(licenses).map((l) => {
lmap[l[0].substring(0, l[0].indexOf('@', 2))] = l[1].licenses
})
packages.packages.forEach((p)=>{
@onion2k
onion2k / freact.sh
Created April 5, 2019 09:05
Find js files that are importing React in a deeply nested project.
#!/bin/bash
for entry in $(find $1 -name '*.js')
do
if [ -f "$entry" ];then
echo $entry | grep "static" > /dev/null 2>&1
STATIC=$?
if [ $STATIC -eq 0 ]; then
continue;
fi
@onion2k
onion2k / react-native-reset.sh
Created October 30, 2018 10:30
Completely reset a React Native project's caches
rm -rf node_modules && rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/haste-map-react-native-packager-* && rm -rf $TMPDIR/metro-bundler-cache-* && watchman watch-del-all && rm -rf ios/build && npm cache clean --force && npm i && npm start -- --reset-cache
@onion2k
onion2k / dabblet.css
Last active April 18, 2018 05:54
Scrollable tiles
/**
* Scrollable tiles
*/
body {
overflow-x: hidden;
}
main {
position: absolute;
@onion2k
onion2k / dabblet.css
Last active April 18, 2018 05:43
Scrollable tiles
/**
* Scrollable tiles
*/
body {
}
main {
position: absolute;
overflow-x: hidden;
@onion2k
onion2k / dabblet.css
Created April 17, 2018 19:54
Scrollable tiles
/**
* Scrollable tiles
*/
body {
transform: rotate(-2deg);
}
main {
margin: -25vw -10vw 0 -10vw;
@onion2k
onion2k / dabblet.css
Last active April 17, 2018 19:25
Scrollable tiles
/**
* Scrollable tiles
*/
main {
margin: -25vw -10vw 0 -10vw;
display: grid;
grid-auto-rows: 30vw;
grid-template-columns: 15vw repeat(3, 30vw) 15vw;
grid-gap: 2px;
@onion2k
onion2k / dabblet.css
Last active March 27, 2018 20:47
Different ways of spanning grid columns
/**
* Different ways of spanning grid columns
*/
article {
display: grid;
grid-template-rows: 20px repeat(6, 30px);
grid-template-columns: repeat(5, 30px);
grid-gap: 1px;
grid-auto-flow: column;
@onion2k
onion2k / dabblet.css
Created March 23, 2018 06:58
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;