Skip to content

Instantly share code, notes, and snippets.

View brev's full-sized avatar
🎯
Focusing

Brev Patterson brev

🎯
Focusing
View GitHub Profile
@brev
brev / issue_svelte-inview_dependencies_package.json
Last active March 17, 2023 22:27
issue_svelte-inview_dependencies
{
"dependencies": {
"@sveltejs/adapter-node": "^1.2.3",
"@sveltejs/kit": "1.10.0",
"@sveltekit-i18n/base": "^1.2.1",
"@sveltekit-i18n/parser-default": "^1.0.3",
"autoprefixer": "^10.4.14",
"clean-redirect": "^1.0.0",
"computed-style-to-inline-style": "^3.0.0",
"cssnano": "^5.1.15",
@brev
brev / text_replace_subtree.sh
Last active January 10, 2019 04:52
Text replacement recursive in subtree.
#!/bin/sh
find /search/path/ -type f -not -path '*/.git/*' | LANG=C LC_ALL=C LC_CTYPE=C xargs sed -i '' -e 's/before/after/g'
@brev
brev / feed_graphite.sh
Created June 10, 2016 20:52
Feed Data to Graphite Server
echo "local.random.diceroll 4 `date +%s`" | nc localhost 2003
@brev
brev / python_cookbook.md
Last active July 26, 2017 16:21
Python Cookbook

Python Cookbook

  • Programs are composed of modules,
  • Modules contain statements,
  • Statements contain expressions,
  • Expressions create and process objects.

Functions

@brev
brev / unix_cookbok.md
Last active August 25, 2022 14:10
Unix Cookbook

Unix Cookbook

System

Find system naming:

uname  # os
uuname -l  # short
uname -a # detailed
@brev
brev / git-merge-abort.sh
Created July 27, 2015 17:49
Git Merge Abort
# oops merge went bad!
git reset --hard HEAD
@brev
brev / git-checkout-branch-and-track.sh
Created May 14, 2015 21:30
Git checkout remote branch and track
# Checkout remote branch and track (without renaming needs)
git fetch origin
git checkout --track origin/branchname
@brev
brev / git-overwrite-branch.sh
Created May 14, 2015 21:27
Git overwrite branch with another branch
# overwrite master with contents of seotweaks branch (seotweaks > master)
git checkout seotweaks # source name
git merge -s ours master # target name
git checkout master # target name
git merge seotweaks # source name
@brev
brev / lsof80.sh
Created February 5, 2015 20:30
Find process using port
# find what's on port 80
sudo lsof -i :80
@brev
brev / access.log.parse.js
Last active August 29, 2015 14:13
access.log Parsing Node.js
#!/usr/bin/env node
var fs = require('fs'),
geoip = require('geoip-lite'),
filename = process.argv[2] || 'access.log',
byHour = {}; // storage hash
console.log('! loading ', filename);
fs.readFile(filename, function(error, data) {