Skip to content

Instantly share code, notes, and snippets.

View NigelThorne's full-sized avatar

Nigel Thorne NigelThorne

View GitHub Profile
@NigelThorne
NigelThorne / InvertCol.md
Last active October 20, 2015 02:48
Invert brightness of #RRGGBB values references in text. Used to transform tmTheme files to with with NegativeScreen

Takes a file. Returns (stdout) a version with all references to colors in the format #rrggbb replaced with the inverse color (where inverse means the brightness is inverted)

I use this with NegativeScreen.exe and Chrome plugin "Deluminate" to make most apps have a black background.

@NigelThorne
NigelThorne / Readme.md
Last active October 19, 2015 06:29
Atlassian Slack - show build status from Teamcity. Ignore tester branches. Add Buttons to resize code review window.

installation

  • Install controlfreak in chrome
  • Add script for PullRequest page
  • Add JQuery library
@NigelThorne
NigelThorne / PurpleOp2.rb
Created October 7, 2012 08:00
PurpleOp0.2
require 'java'
module Purugin
module Event
# FIXME: This only handles normal priority. Real fix is to generate these on demand versus up
# front. We can reify what we need. This will also fix custom event types.
require 'jruby/core_ext'
@NigelThorne
NigelThorne / purple_op_plugin.rb
Created October 6, 2012 11:17
PurpleOp0.3 = Minecraft Purugin Plugin.
require 'java'
java_import org.kitteh.tag.PlayerReceiveNameTagEvent
java_import org.kitteh.tag.TagAPI
module Purugin
module Event
# FIXME: This only handles normal priority. Real fix is to generate these on demand versus up
# front. We can reify what we need. This will also fix custom event types.
@NigelThorne
NigelThorne / gist:2992186
Created June 25, 2012 23:57
grep on windows
@REM On windows grep's slashes are the wrong way around.
@"%~dp0tools\grep.exe" %* | ruby -n -e' x = $_.split(":"); x[0].gsub!(/\//, "\\"); puts x.join(":")'
@NigelThorne
NigelThorne / load_jquery.js
Created May 8, 2012 22:51
Load JQuery & JQueryUI programatically
//Taken from http://www.jquery4u.com/javascript/dynamically-load-jquery-library-javascript/
//Load jQuery library using plain JavaScript
(function(){
var newscript = document.createElement('script');
newscript.type = 'text/javascript';
newscript.async = true;
newscript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(newscript);
})();
@NigelThorne
NigelThorne / gist:2424782
Created April 19, 2012 23:07
AutoHotKey Script for CNC style window focus control
; AutoHotKey script file
; press Ctrl+win+1 to make Win+1 give focus to whatever the current window is
; press Ctrl+win+2 to make Win+2 give focus to whatever the current window is
; press Ctrl+win+3 to make Win+3 give focus to whatever the current window is
; press Ctrl+win+4 to make Win+4 give focus to whatever the current window is
; press Ctrl+win+5 to make Win+5 give focus to whatever the current window is
;;;;;;;;;;;;;;;;;CNC KEYS;;;;;;;;;;;;;;;;;;;;;;;;;
CNCKey1 =
^#1:: ;save current focused window to a variable
@NigelThorne
NigelThorne / gist:1408193
Created November 30, 2011 05:41
monadic stack attempt in coffee script
# GOAL - immutable objects
# to make these composable they need to both have the same signature...
compose = (f, g) -> (x) -> g(f(x))
c = (f, args...) ->
if(f)
compose(f, c.apply(this,args))
else
nil
@NigelThorne
NigelThorne / worst_code.rb
Created November 29, 2011 02:48
Report On the Worst code in your codebase (for some definition of worst) as reported by Team City and NCover
# Report On the Worst code in your codebase (for some definition of worst) as reported by Team City and NCover
# *******This works for us.. may need editing to work for you!********
# By Nigel Thorne (nwt) www.nigelthorne.com
# https://gist.github.com/gists/1403141
#install :
# once ruby is installed...
# and in your path
# gem install nokogiri
# gem install mechanize