Skip to content

Instantly share code, notes, and snippets.

View ahawthorne's full-sized avatar

Andrew Hawthorne ahawthorne

View GitHub Profile
@ahawthorne
ahawthorne / 20-intel.conf
Created January 12, 2016 22:56
xorg config to fix rendering issues in chrome
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "glamor"
Option "DRI" "3"
Option "TearFree" "true"
Option "SwapbuffersWait" "true"
EndSection
@ahawthorne
ahawthorne / fix_hash.vim
Last active September 28, 2015 21:26
Vim command to fix ruby hashes. Make them in 1.9 format
function! s:FixHash(line1,line2)
let l:save_cursor = getpos(".")
silent! execute ':' . a:line1 . ',' . a:line2 . 's/\%(''\|:\)\([a-zA-Z0-9_]\+\)\%(\s*=>\|''\s*=>\|'':\)/\1:/g'
call setpos('.', l:save_cursor)
endfunction
command! -range=% FixHash call <SID>FixHash(<line1>,<line2>)
def renderActionInOtherController(controller,action,params)
c = controller.new
c.params = params
c.dispatch(action, request)
c.response.body
end
@ahawthorne
ahawthorne / php-opcache.ini
Created June 10, 2015 01:59
php 5.5 opcache
[opcache]
; Determines if Zend OPCache is enabled
;opcache.enable=0
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0
opcache.enable_cli=1
; The OPcache shared memory storage size.
@ahawthorne
ahawthorne / gist:40672b6f3106ebf71549
Last active November 4, 2015 16:48
rbenv install
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
export RBENV_PLUGINS="$HOME/.rbenv/plugins"
git clone git://github.com/sstephenson/rbenv-vars.git ${RBENV_PLUGINS}/rbenv-vars
git clone git://github.com/sstephenson/ruby-build.git ${RBENV_PLUGINS}/ruby-build
git clone git://github.com/sstephenson/rbenv-default-gems.git ${RBENV_PLUGINS}/rbenv-default-gems
git clone git://github.com/fesplugas/rbenv-installer.git ${RBENV_PLUGINS}/rbenv-installer
@ahawthorne
ahawthorne / .rubocop.yml
Created March 23, 2015 15:06
Rubocop config
Style/Documentation:
Enabled: false
Style/WordArray:
MinSize: 4
Metrics/LineLength:
Max: 120
Metrics/AbcSize:
<?xml version="1.0" encoding="utf-8"?>
<Client name="Chromecast">
<!-- Author: Plex Inc. -->
<TranscodeTargets>
<VideoProfile protocol="http" container="matroska" codec="h264" audioCodec="aac" subtitleCodec="ass" context="streaming">
<Setting name="VideoEncodeFlags" value="-x264opts bframes=3:cabac=1" />
</VideoProfile>
<MusicProfile container="matroska" codec="mp3" />
<PhotoProfile container="jpeg" />
</TranscodeTargets>
/* ghosttest.c: GHOST vulnerability tester */
/* Credit: http://www.openwall.com/lists/oss-security/2015/01/27/9 */
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
@ahawthorne
ahawthorne / gist:7201871
Created October 28, 2013 18:20
quick touchpad fix
synclient PalmDetect=1 PalmMinWidth=1 PalmMinZ=1 VertScrollDelta=40 HorizScrollDelta=40 CoastingSpeed=1 CoastingFriction=60 TapButton1=1 TapButton2=3 TapButton3=2 VertTwoFingerScroll=1 HorizTwoFingerScroll=1 FingerHigh=45 FingerLow=40 EmulateMidButtonTime=180
@ahawthorne
ahawthorne / 10-touchpad.conf
Created October 7, 2013 16:14
Default touchpad configuration in Fedora (and Linux in gerneral) is pretty frustrating. This configuration should provide palm detection, scroll coasting, tap-to-click (without jumpiness), two-finger scrolling, and three-finger middle click Place this file in /etc/X11/xord.conf.d/. Set owner and group to root, permissions to 644.
Section "InputClass"
Identifier "Touchpad"
Driver "synaptics"
MatchIsTouchpad "on"
Option "PalmDetect" "1"
Option "PalmMinWidth" "1"
Option "PalmMinZ" "1"
Option "VertScrollDelta" "40"
Option "HorizScrollDelta" "40"
Option "CoastingSpeed" "1"