Skip to content

Instantly share code, notes, and snippets.

View unyo's full-sized avatar

Cody Moniz unyo

View GitHub Profile
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="TARDIS"
psk="XXXX"
proto=RSN
key_mgmt=WPA-PSK
}
runinstaller quiet ramdisk_size=32768 root=/dev/ram0 init=/init vt.cur_default=1 elevator=deadline silentinstall
@unyo
unyo / fstab
Created July 30, 2018 02:28
mkdir /mnt/usb && sudo vi /etc/fstab
UUID=2266-BC8E /mnt/usb vfat auto,user,rw,uid=unyo,gid=unyo 0 0
@unyo
unyo / nested-data.js
Last active August 4, 2018 00:06
Get and Set Nested Data in an Array
// # setNestedData
export function setNestedData(root, path, value) {
var paths = path.split('.');
var last_index = paths.length - 1;
paths.forEach(function(key, index) {
if (!(key in root)) root[key] = {};
if (index==last_index) root[key] = value;
root = root[key];
});
return root;
@unyo
unyo / package-list.txt
Last active August 9, 2018 18:41
Atom.io Plugin List (ES6 JSX React Redux MobX)
Sublime-Style-Column-Selection@1.7.4
atom-beautify@0.32.4
atom-jade@0.3.0
auto-detect-indentation@1.3.0
auto-indent@0.5.0
autocomplete-modules@2.0.0
blame@1.0.1
busy-signal@1.4.3
custom-title@1.0.1
emmet@2.4.3
@unyo
unyo / initiate.sh
Last active October 1, 2018 05:02
OSX initiation script
# # Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# # Install apps
brew install docker docker-compose tmux wget curl git
brew cask install atom slate blender ultimaker-cura google-chrome gimp firefox gqrx inkscape keka figma slack synergy zoom.us virtualbox vlc
# # Install settings files
wget https://gist.githubusercontent.com/unyo/bfcdfc81a66d2101c67aced713f5dedd/raw/3adc63023d3fc531dd8f8f87ee27c92d3485841f/.bashrc
wget https://gist.githubusercontent.com/unyo/b405b78b5a01926fbbce0452c4b69eaf/raw/0a3159012de010913eb87e887a6cd2c84568bb80/.slate
wget https://gist.githubusercontent.com/unyo/284cbbd269cde81f85b9e4162a6b6128/raw/f1cb2ec4dc4bb319124cb9f58f42ded7bcf5a4bf/.vimrc
wget https://gist.githubusercontent.com/unyo/8f280210381ff9a3f41fb7ab4cff7d43/raw/3b902fff44959c2443d8ad3ece1da63c54e69978/package-list.txt
@unyo
unyo / gatsby-ssr.js
Created January 29, 2019 00:49
Remove gatsby FOUC (flash of unstyled content / text)
// apparently there is some hidden settings at https://www.gatsbyjs.org/docs/debugging-replace-renderer-api/#fixing-the-replacerenderer-error
import React from "react"
import { renderToString } from "react-dom/server"
import { ServerStyleSheet, StyleSheetManager } from "styled-components"
export const replaceRenderer = ({
bodyComponent,
replaceBodyHTMLString,
setHeadComponents,
}) => {
https://keithclark.co.uk/articles/pure-css-parallax-websites/demo1/
Basically, the idea is:
Top-level page container element (contains navbar body footer, the level which the main scrollbar will be) requires:
#___gatsby {
perspective: 1px;
overflow: auto;
height: 100%;
@unyo
unyo / get-object-keys.js
Last active March 23, 2019 03:07
get all object keys js
const getObjectKeys = (obj, prefix = '') => {
return Object.entries(obj).reduce((collector, [key, val]) => {
const newKeys = [ ...collector, prefix ? `${prefix}.${key}` : key ]
if (Object.prototype.toString.call(val) === '[object Object]') {
const newPrefix = prefix ? `${prefix}.${key}` : key
const otherKeys = getObjectKeys(val, newPrefix)
return [ ...newKeys, ...otherKeys ]
}
return newKeys
}, [])