Skip to content

Instantly share code, notes, and snippets.

Justin Force justinforce

Block or report user

Report or block justinforce

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@justinforce
justinforce / 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)
@justinforce
justinforce / 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
#
@justinforce
justinforce / 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}
@justinforce
justinforce / 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==
@justinforce
justinforce / ascii_only.rb
Created Jan 29, 2016
Report non-ASCII characters in a file
View ascii_only.rb
#!/usr/bin/env ruby
# x starts at 0 because we increment x BEFORE checking the character.
# y starts at 1 because we only increment it when we hit a newline.
x, y = 0, 1
puts 'Positions are 1-indexed, NOT 0-indexed.'
puts 'i.e. The first character in the file is at position 1:1'
puts
View concatenate-vs-join.rb
require 'benchmark/ips'
STRINGS = %w[
There's no beginning to this story. A bookshelf sinks into the sand. And a
language learned, a forgotten term, is studied once again. It's a shocking
bit of footage viewed from a shitty TV screen. Just squint at it, just snowy
static to make out the meaning. And keep on stretching the antenna hoping that
it will come clear. We need some reception, a higher message. Just tell us
what to fear 'cause I don't know what tomorrow brings. It's alive with such
possibility. All I know is I feel better when I sing.
View Fireworks!.markdown

Fireworks!

You can click and drag then release to fling them, or press F for a fireworks show. Pressing any key will detonate all currently visible fireworks. There's a commented bit that activates the game when the Konami code is entered on the keyboard.

A Pen by Justin Force on CodePen.

License.

View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

You can’t perform that action at this time.