Skip to content

Instantly share code, notes, and snippets.

View ElijahLynn's full-sized avatar
😎
All Your DevOps Belong To Us

Elijah Lynn ElijahLynn

😎
All Your DevOps Belong To Us
View GitHub Profile
document.write('\x3cimg src\x3d\x22https://secure-gl.imrworldwide.com/cgi-bin/m?ci\x3dncs2016\x26amp;at\x3dview\x26amp;rt\x3dbanner\x26amp;st\x3dimage\x26amp;ca\x3dchase_ev_012417\x26amp;cr\x3d80580412\x26amp;pc\x3d144822244\x26amp;ce\x3d10787013_DCM\x26amp;rnd\x3d3209337560\x22 height\x3d\x221\x22 width\x3d\x221\x22 border\x3d\x220\x22\x3e\x3cscript type\x3d\x22text/javascript\x22 src\x3d\x22https://s.admathhd.com/2/675511/analytics.js?ac\x3d10787013\x26amp;si\x3d851407\x26amp;pc\x3d144822244\x26amp;pi\x3d319652813\x26amp;cr\x3d80580412\x26amp;dm\x3d\x26amp;ai\x3d3092936\x26amp;ui\x3dAMsySZY-5abb1GYAnjQ-u_lv224d\x26amp;cb\x3d3209337560\x26amp;pp\x3dN5762.wsjdn.com\x26amp;dt\x3d6755111439323588633001\x22\x3e\x3c/script\x3e');(function() {if (!window.GoogleTyFxhY || typeof window.GoogleTyFxhY.push !== 'function') {window.GoogleTyFxhY = [];}window.GoogleTyFxhY.push({'_scs_': 'BR2W_jGbVWOPCBI-xMfbOi7gDAAAAADgB4AQC','_bgu_': 'https://pagead2.googlesyndication.com/bg/db7KNPtkE4zG9BtR4cnMZHttZikK_5y0_126agzRcbU.js'
@ElijahLynn
ElijahLynn / droplet_delete_all.fish
Last active September 30, 2020 12:37
Delete all Digital Ocean droplets - good for testing
function droplet_delete_all
echo "Getting list of droplets"
set --local droplets (doctl compute droplet list | tail --lines=+2 | awk '{print $2}')
if test -n "$droplets"
echo "Deleting droplets: $droplets"
for droplet in $droplets
doctl compute droplet delete $droplet
echo "Deleted droplet: $droplet"
end
else
@ElijahLynn
ElijahLynn / change_timezone.fish
Last active March 14, 2017 02:41
Quickly change timezone from the command line
# I make an abbreviation with `abbr --add ct change_timezone` and then just type `ct ny`.
function change_timezone --description "Change timezone to; LA or NY"
set --local zone $argv[1]
if string match --ignore-case --quiet 'LA' $zone
timedatectl set-timezone America/Los_Angeles
echo 'set zone to America/Los_Angeles'
else if string match --ignore-case --quiet 'NY' $zone
timedatectl set-timezone America/New_York
echo 'set zone to America/New_York'
else
@ElijahLynn
ElijahLynn / hello.cpp
Last active February 25, 2017 01:23
Strace: Intro Tutorial - Hello World > Goodbye Child
// Strace: Intro Tutorial by Alex Mah
// https://www.youtube.com/watch?v=EG0ihttnEJI
#include <iostream>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
using namespace std;

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@ElijahLynn
ElijahLynn / gist:239d9f287757132bf025bae198a635ac
Created November 24, 2016 19:20
Fix Ubuntu 14.04 Magic mouse speed and scrolling
sudo rmmod hid_magicmouse
sudo modprobe hid_magicmouse scroll-speed=50 scroll-acceleration=1
xinput --set-prop "Elijah's mouse" "Device Accel Constant Deceleration" 5
@ElijahLynn
ElijahLynn / replify
Created August 19, 2016 22:13 — forked from danielrw7/ replify
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for [%s]\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "\n%s> " "$command"
@ElijahLynn
ElijahLynn / syncdb manual gnu parallel import command
Created June 21, 2016 16:42
Run this in bash, won't work in fish.
find /tmp/user/1000/syncdb/loc_mvpd_admin -name '*sql' | parallel --use-cpus-instead-of-cores --jobs 700% -v drush sql-query --file={}
@ElijahLynn
ElijahLynn / pagination.md
Created February 2, 2016 12:18 — forked from mislav/pagination.md
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

@ElijahLynn
ElijahLynn / pipe_to_docker_examples
Last active March 13, 2024 03:29
How to pipe to `docker exec` examples
# These examples assume you have a container currently running.
# 1 Pipe from a file
sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt`
#2a Pipe by piping
echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash -