Skip to content

Instantly share code, notes, and snippets.

⌨️
Clicking away on my new Model M. It's a lovely sound.

Jay Williams jaywilliams

⌨️
Clicking away on my new Model M. It's a lovely sound.
Block or report user

Report or block jaywilliams

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
@jaywilliams
jaywilliams / searchd
Last active Jan 9, 2019
A working OpenBSD Sphinx Search rc.d init script
View searchd
#!/bin/ksh
#
# searchd - Sphinxsearch network daemon
#
# Use --nodetach flag in combination with rc_bg to workaround searchd not
# listening on specified network ports
daemon="/usr/local/bin/searchd"
daemon_flags="--nodetach"
# daemon_user="www"
View highdpi.md

See Also: https://wiki.archlinux.org/index.php/Xorg#Setting_DPI_manually

Setting DPI manually Note: While you can set any dpi you like and applications using Qt and GTK will scale accordingly, it's recommended to set it to 96, 120 (25% higher), 144 (50% higher), 168 (75% higher), 192 (100% higher) etc., to reduce scaling artifacts to GUI that use bitmaps. Reducing it below 96 dpi may not reduce size of graphical elements of GUI as typically the lowest dpi the icons are made for is 96.

# The bang exclamation is used for comments in the Xresources file
nano $HOME/.Xresources
------------------------------------------------
!Xft.dpi: 96
@jaywilliams
jaywilliams / install-mosh.sh
Last active Aug 14, 2019 — forked from palexander/gist:2975305
Compiling and running mosh on Dreamhost (Updated - 2018)
View install-mosh.sh
#!/usr/bin/env bash
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME/local
VERSION=1.3.2
# Create Source Directory
mkdir -p $PREFIX/src
@jaywilliams
jaywilliams / .htaccess
Last active Jun 7, 2018
Magento 2 SSL Redirect Loop Fix (Apache + Varnish + Nginx)
View .htaccess
# Add this to your the Magento .htaccess file located in your docroot
############################################
## Nginx proxy HTTPS Fix for Magento
## Source: https://www.sonassi.com/blog/magento-kb/magento-https-redirect-loop-2
SetEnvIf X-Forwarded-Proto https HTTPS=on
View deploy.rb
set :repo_url, 'git@github.com:Design-Collective/some-repo.git'
set :application, 'the-app-name.com'
set :theme_name, 'sage'
# Branch options
# Prompts for the branch name (defaults to current branch)
#ask :branch, -> { `git rev-parse --abbrev-ref HEAD`.chomp }
# Hardcodes branch to always be master
# This could be overridden in a stage config file
@jaywilliams
jaywilliams / sub_category_products.xml
Created Dec 19, 2013
A vQmod for OpenCart 1.5.6 to display products in sub-categories.
View sub_category_products.xml
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Display products in sub-categories while browsing a parent category</id>
<version>1.0.0</version>
<vqmver>2.4.0</vqmver>
<author>Jay Williams - jay@myd3.com</author>
<file name="catalog/controller/product/category.php">
<operation>
<search position="after"><![CDATA['filter_category_id' => $category_id,]]></search>
<add><![CDATA[ 'filter_sub_category' => true,]]></add>
@jaywilliams
jaywilliams / gist:4692466
Created Feb 1, 2013
Your problem with Vim is that you don't grok vi.
View gist:4692466

###Your problem with Vim is that you don't grok vi.

Source: http://stackoverflow.com/a/1220118/540977

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a synonym for y_. The y is doubled up to make it easier to type, since it is such a common operation.

This can also be expressed as dd P (delete the current line and paste a copy back into place; leaving a copy in the anonymous register as a side effect). The y and d "verbs" take any movement as their "subject." Thus yW is "yank from here (the cursor) to the end of the current/next (big) word" and y'a is "yank from here to the line containing

@jaywilliams
jaywilliams / convert.php
Last active May 4, 2019
# Convert a QuickBooks QBXML Report to HTML/CSV File # I created this little script to help me read through the raw XML responses from QuickBooks. I originally built it to export to a CSV file, but found that a simple HTML table was better suited for my usage. However, I've included the CSV code below for anyone who may need that functionality. …
View convert.php
<?php
/**
* Convert a QuickBooks QBXML Report to HTML/CSV File
*
* I created this little script to help me read through the raw XML responses
* from QuickBooks. I originally built it to export to a CSV file, but found
* that a simple HTML table was better suited for my usage. However, I've
* included the CSV code below for anyone who may need that functionality.
*
@jaywilliams
jaywilliams / Twilight Terminal Theme.mdown
Created Aug 1, 2012
Twilight Theme Terminal Colors
View Twilight Terminal Theme.mdown

Twilight Theme Terminal Colors

Based on the timeless TextMate theme.

Basic Colors

Foreground:     #FEFFD3
Background:     #141414
@jaywilliams
jaywilliams / gist:3035044
Created Jul 2, 2012
Auto-Install Sublime Text 2 Twig Bundle
View gist:3035044
curl https://nodeload.github.com/Anomareh/PHP-Twig.tmbundle/tarball/master | tar xvz -C ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/ && mv ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Anomareh-PHP-Twig.tmbundle* ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/TWIG/
You can’t perform that action at this time.