Skip to content

Instantly share code, notes, and snippets.

@staydecent
staydecent / renamefiles.fish
Created November 17, 2014 17:46
File renaming pattern for Fish Shell with OSX sed
# 'Item*' it the pattern to look for
# sed "s/I/i/g" is the replacement pattern
for f in Item*; mv $f (echo {$f} | sed "s/I/i/g"); end
@staydecent
staydecent / Emmet.sublime-settings
Last active November 4, 2022 01:25
Sublime Prefs
{
"disable_tab_abbreviations_for_scopes": "string"
}
@staydecent
staydecent / init.vim
Last active December 1, 2021 00:46
neovim config vim init vimrc
set nocompatible
set modelines=0
set wildcharm=<C-z>
filetype off
" save swap files globally
set directory^=$HOME/.vim/tmp//
" Tabs
@staydecent
staydecent / config.fish
Last active December 1, 2021 00:45
My Fish config
if status is-interactive
# Commands to run in interactive sessions can go here
end
set -gx PATH /usr/local/bin $PATH
set -gx PATH /opt/homebrew/bin $PATH
set -gx PATH /opt/homebrew/opt/python@3.9/libexec/bin $PATH
abbr gf "git fetch"
abbr gb "git branch"
@staydecent
staydecent / styles.less
Last active June 4, 2021 04:44
Smaller, more compact tab-bar for Atom.io
.tab-bar {
height: 34px;
padding: 0;
.tab {
-webkit-transform: none;
top: 2px;
line-height: 25px;
&.active {
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs": false,
"confirmCloseAllTabs": false,
"showTabsInTitlebar": false,
"theme": "light",
"defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",
@staydecent
staydecent / react-tooling-times.txt
Created February 4, 2021 19:10
Rough idea of execution times for bootstrapping and building react projects with various tooling
// NEXT (10.0.0)
// ---
time npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn-starter/tree/master/learn-starter"
----------------------------------------------
112.68 real 15.44 user 6.49 sys
time npm run build
----------------------------------------------
13.84 real 15.19 user 1.07 sys
import equal from '@app-elements/equal'
import { useEffect, useReducer, useRef } from 'preact/compat'
export function useMappedState (store, mapper) {
const [, forceRender] = useReducer(s => s + 1, 0)
const initialState = mapper(store.getState())
const mappedStateRef = useRef(initialState)
useEffect(() => {
function checkForUpdates () {
@staydecent
staydecent / media_queries.css
Created June 12, 2011 17:46
Example of various media queries for responsive web design.
/* Media queries used on blog.staydecent.ca by Adrian Unger
check my full source at:
http://blog.staydecent.ca/static/css/style-0.1.6.css */
@media only screen and (min-width:768px) and (max-width:1269px) {
/* In my particular design, I used a fluid grid limited to a
max-width of 1140px, while (if there is enough room)
pushing the menu outside of layout, requiring a total
limit of at least 1270px.
So, this first query applies to any screen-width less
import {
createContext,
useContext,
useEffect,
useReducer,
useRef
} from "preact/compat";
import { getRouteComponent, getAllRoutes, getHref } from "./util";
const EMPTY = Symbol();