Skip to content

Instantly share code, notes, and snippets.

View Swivelgames's full-sized avatar

Joseph Dalrymple Swivelgames

View GitHub Profile
@Swivelgames
Swivelgames / README
Created March 26, 2020 15:00 — forked from dejanr/README
OSX, X11, dwm, urxvt, vim environment
OSX Apps
- Total Spaces, for keeping X11 in different space and faster switching
- MenuAndDockless for hidding topbar menu
X11 - Macports
- sudo port install xorg-server
- sudo port install xinit
- sudo port install terminus-font dejavu-fonts bitstream-fonts
Suckless - suckless.org
" Get the defaults that most users want.
source $VIMRUNTIME/defaults.vim
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file (restore to previous version)
if has('persistent_undo')
set undofile " keep an undo file (undo changes after closing)
endif
@Swivelgames
Swivelgames / tmux.conf
Last active April 8, 2019 17:00
My tmux configuration
set-option -g default-shell /bin/zsh
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
@Swivelgames
Swivelgames / .gitconfig
Last active February 12, 2019 22:16
Useful Git Aliases
# ...
[pull]
# Use rebase when running git-pull (Recommended)
rebase = true
[core]
# Treat filename casing strictly
ignorecase = false
[pager]
# Do not open up the default kernel's pager for git-branch
branch = false
@Swivelgames
Swivelgames / dance.js
Last active October 3, 2018 19:13
Dance elements on a webpage
const randBetween = (min, max) => Math.floor(Math.random() * max) + min;
const dance = () => {
const all = document.body.querySelectorAll('*');
return Array.prototype
.slice.apply(all)
.reduce(
(promise, e) => promise.then(
new Promise((resolve, reject) => setTimeout(() => {
@Swivelgames
Swivelgames / revert-git-changes.md
Last active August 28, 2018 21:27
Simple revert all commits between HEAD and COMMIT_X in git

Grab the commit you want to revert back to

$ git log

You should see a less'd list of your log in descending chronological order (top of the list is your most recent commit).

  • Find the commit you want to revert back to.
  • Copy the hash (hexadecimal string, like: "b4533eeac95f970d131452b08db9094e8e07a260")
@Swivelgames
Swivelgames / hidePRfilesWithExtension.md
Last active April 10, 2018 20:59
Hide Files with FILE_EXTENSION when previewing PRs

Hide files with certain extension when previewing PR’s on Github

Usage

Change FILE_EXTENSION and then paste into Developer Tools console and execute.

Hidden feature: Automatically steals your information and uploads it to Chinese servers. I mean, uh… use this to hack someone’s facebook account! :D

@Swivelgames
Swivelgames / FirebaseUpdateCfg.js
Created January 22, 2018 17:43
Firebase Configuration Updater
#!/usr/bin/env node
/* eslint-disable import/no-extraneous-dependencies, no-console */
const path = require('path');
const yargs = require('yargs');
const fs = require('fs');
const { spawn } = require('child_process');
const argv = yargs
.option('f', {
alias: 'file',
@Swivelgames
Swivelgames / gist:94f6b2a10c298f59dbdd96f1f75fe6f8
Last active February 12, 2019 22:01 — forked from devisnotnull/installing_kubernetes_on_proxox.md
Installing Kubernetes on Proxox, Herzner

Installing Kubernetes on Proxmox

For this example i shall be using a dedicated server from Hertzner.https://www.hetzner.de/en/. A shout out to hetzner if your looking for cheap and beefy dedicated hosting then these guys are your best bet.

Setting up the Hertzer server

This guide assumes your server has Debian 8 (Jessie installed)

Config when tested

@Swivelgames
Swivelgames / toTwelveHour.js
Last active November 13, 2017 17:46
24 to 12 hour clock
/* golf */
const toTwelveHour = time => {
const [hr,min] = time.split(':');
return `${hr>12?hr-12:hr==0?12:hr}:${min}${hr>12?'PM':'AM'}`;
}
/* expanded utility */
const toTwelveHour = (time) => {
const [hour, min] = time.split(':');
const suffix = hour > 12 ? 'PM' : 'AM';