Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Force e0da

View GitHub Profile
@e0da
e0da / README.md
Last active Sep 16, 2020
Prompts
View README.md

e0da prompt

e0da prompt example

.zshrc goes in $HOME, everything else goes in $HOME/share, and you want to brew install zsh-git-prompt. I'm using Gruvbox here with macOS Terminal.

@e0da
e0da / Enable no-restricted-syntax ForOfStatement when extending airbnb-base in .eslintrc.js
Last active Aug 26, 2020
Disable the airbnb style guide rules that violates the no-restricted-syntax rule when using for...of loops in JavaScript, which are incredible and a wonderful and perfectly valid alternative to Array.prototype.forEach. Fight me.
View Enable no-restricted-syntax ForOfStatement when extending airbnb-base in .eslintrc.js
module.exports = {
extends: ["airbnb-base"],
rules: {
"no-restricted-syntax": [
"error",
/**
* for...of is wonderful! Copy the rest of Airbnb's rules.
* Gist permalink: https://gist.github.com/e0da/e539c6aa220eedd0cf76dc94e1e26ed9
* Airbnb source: https://github.com/airbnb/javascript/blob/a24dc34a4a2748c99006a48e997aa0a06b1d4d94/packages/eslint-config-airbnb-base/rules/style.js#L339-L357
* Feature discussion: https://github.com/airbnb/javascript/issues/1271#issuecomment-548688952
View terminator.sh
terminator=$(mktemp --dry-run /tmp/terminator.XXX)
echo "touch $terminator to stop"
(
while true; do
if [[ -f "$terminator" ]]; then
kill "$CHILD_PID"
echo "Killed $CHILD_PID because the main container terminatord."
exit
fi
sleep 1
View favify.bash
#!/bin/bash -ex
# https://gist.github.com/justinforce/f1ddc69f63f95deeb3c0f0d2cf44b202
input=${1:-favicon.svg}
output=${2:-favicon.ico}
# https://gist.github.com/azam/3b6995a29b9f079282f3#gistcomment-2958717
convert \
-density 256x256 \
-background transparent \
@e0da
e0da / DellXPS15_9560_AHCI_RAID.md
Created Sep 4, 2019 — forked from chenxiaolong/DellXPS15_9560_AHCI_RAID.md
Switching between AHCI and RAID on the Dell XPS 15 (9560)
View DellXPS15_9560_AHCI_RAID.md

Switching between AHCI and RAID on the Dell XPS 15 (9560)

This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.

Switching from RAID to AHCI

Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.

  1. To set the default boot mode to Safe Mode, use msconfig.exe or open an admin cmd/PowerShell window and run:
View sql.rb
cur.execute(<<-'SQL'.gsub('%s', tablename))
INSERT INTO `%s`
SELECT cs.nodeid, dbs.name database, rels.name `table`,
reps.name `index`, sum(reads) reads,
sum(deletes+inserts+replaces) writes,
count(cs.replica) replicas
FROM system.`databases` AS dbs
JOIN system.`relations` AS rels USING (db)
JOIN system.`representations` AS reps
ON (reps.relation = rels.table)
@e0da
e0da / xterm-256color-italic.terminfo
Created May 9, 2018 — forked from sos4nt/xterm-256color-italic.terminfo
A xterm-256color based TERMINFO that adds the escape sequences for italic
View xterm-256color-italic.terminfo
# A xterm-256color based TERMINFO that adds the escape sequences for italic.
#
# Install:
#
# tic xterm-256color-italic.terminfo
#
# Usage:
#
# export TERM=xterm-256color-italic
#
@e0da
e0da / simcity_2000_mouse_scroll_bindings.ahk
Last active Aug 20, 2017
Use the vertical scrolling for zoom and horizontal scrolling for rotation when playing SimCity 2000 (SIMCITY.EXE)
View simcity_2000_mouse_scroll_bindings.ahk
; https://gist.github.com/justinforce/40d551e1302738d931d0c61c163acb22
if WinActive("ahk_exe SIMCITY.EXE") {
WheelUp::
send {Home}
return
WheelDown::
send {End}
@e0da
e0da / iptorrents.css
Last active Aug 7, 2017
Custom styles for IPTorrents
View iptorrents.css
/* https://gist.github.com/justinforce/4b15ff14b225f5b4d500be4ee49a8757 */
#iptStart .topRow {
padding-bottom: 0 !important;
}
#iptStart .banner {
background-image: none !important;
height: 57px !important;
}
View hideHangoutsInInbox.js
// ==UserScript==
// @name Hide Hangouts in Inbox
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Justin Force
// @match https://inbox.google.com/*
// @grant none
// ==/UserScript==
You can’t perform that action at this time.