Skip to content

Instantly share code, notes, and snippets.

@RoryDungan
RoryDungan / mouse.sh
Created January 4, 2016 09:03
Fix crazy fast cursor movement with Razer DeathAdder mouse on Ubuntu
#!/bin/bash
xinput list |
grep -E 'DeathAdder.*pointer' |
awk -F"=" '{print $2}' |
awk '{print $1}' |
while read -r id
do
xinput --set-prop $id "Device Accel Constant Deceleration" 3
xinput --set-prop $id "Device Accel Velocity Scaling" 1
done
@RoryDungan
RoryDungan / .vimrc
Last active November 12, 2016 02:16
.vimrc
" Indentation
set smartindent
" set tabstop=2
" set shiftwidth=2
set tabstop=4
set shiftwidth=4
set expandtab
set autoindent
" Enable autocompletion for file paths
@RoryDungan
RoryDungan / Preferences.sublime-settings
Last active April 5, 2016 01:51
Sublime Text 3 settings
{
"added_words":
[
"favourite"
],
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"ignored_packages":
[
],
@RoryDungan
RoryDungan / Internal-DeferredShading.shader
Created September 29, 2016 03:37
Unity 5.3+ cel shading
Shader "Custom/Internal-DeferredShading" {
Properties {
_LightTexture0 ("", any) = "" {}
_LightTextureB0 ("", 2D) = "" {}
_ShadowMapTexture ("", any) = "" {}
_SrcBlend ("", Float) = 1
_DstBlend ("", Float) = 1
}
SubShader {
set-option -g default-shell /usr/bin/fish
set -s escape-time 1
set -g prefix C-v
setw -g mode-keys vi
set-option -g base-index 1
setw -g pane-base-index 1
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
[user]
name = Rory Dungan
email =
[diff]
tool = winmerge
[difftool "winmerge"]
BoldAsFont=-1
Font=Consolas
FontHeight=11
Transparency=off
Term=xterm-256color
CursorType=block
Scrollbar=none
Locale=en_AU
Charset=UTF-8
import Control.Monad
type KnightPos = (Int, Int)
moveKnight :: KnightPos -> [KnightPos]
moveKnight (c,r) = do
(c',r') <- [(c+2,r-1), (c+2,r+1), (c-2,r+1), (c-2,r-1)
,(c+1,r-2), (c+1,r+2), (c-1,r+2), (c-1,r-2)
]
guard (c' `elem` [1..8] && r' `elem` [1..8])
@RoryDungan
RoryDungan / User Settings.json
Last active August 16, 2018 04:38
VS Code settings
{
"workbench.activityBar.visible": true,
"editor.wordWrap": "off",
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false,
//**/
"editor.fontFamily": "Fira Code",
"editor.fontSize": 14.5,
"editor.letterSpacing": -0.7,
"workbench.colorTheme": "One Dark Pro",
[Binding]
public class PropertyChangedExample : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));