Skip to content

Instantly share code, notes, and snippets.

View NigelThorne's full-sized avatar

Nigel Thorne NigelThorne

View GitHub Profile
@NigelThorne
NigelThorne / infinite_cube.scad
Created July 5, 2022 00:06
An OpenScad model of an infinite cube.
$fn=40;
sz=10;
module ccube(x,y,z){
gap=0.4;
ch=(sz+gap)*0.25;
xoffset = sz * x;
yoffset = sz * y;
zoffset = sz * z;
@NigelThorne
NigelThorne / col
Last active March 1, 2022 00:34
Col returns the specified columns from each line in stdin
#!/usr/bin/bash
# Usage: col x x x
# where x is a column number or + to mean all following columns
#
# example: ls -al | col 6 7 9
# example: ls -al | col 2 7 +
# example: ls -al | col -1
# Here is a fun use... interleave lines from logs from several containers in timestamp order
# docker-compose logs --tail='all' -t | col 3 1 + | sort | col 2 +
@NigelThorne
NigelThorne / nsubl.bat
Created June 24, 2015 03:10
Use sublime text with 7zip
"%~dp0subl.exe" -n -w %1
@NigelThorne
NigelThorne / styler.css
Created March 1, 2012 22:42
WorkFlowy userscript to add css classes to nodes based on their tags
/* I use Stylish (a chome addin) to set these styles
* URLs on the domain workflowy
*/
.next-row {
border: 2px solid #46A546 !important;
border-top-left-radius:0.5em;
background-color: #CCFFCC !important;
}
@NigelThorne
NigelThorne / .gitconfig
Created August 28, 2020 09:13
AzureDevops Git aliases
[alias]
pushu = !git push --set-upstream origin `git symbolic-ref --short HEAD` && git rpr
current-branch-name = !git rev-parse --abbrev-ref HEAD
current-branch-name-escaped = !git escape-url `git current-branch-name`
escape-url = "!f() { perl -MURI::Escape -e \"print uri_escape('"$*"');\"; }; f"
current-push-url = !git remote get-url --push origin
raise-pull-request = !sh -c \"echo -e \\\" \\nRaise a pull request here: \\n `git current-push-url`/pullrequestcreate?sourceRef=`git current-branch-name-escaped`&targetRef=master\\\"\"
rpr = raise-pull-request
@NigelThorne
NigelThorne / .gitalias
Last active August 4, 2020 07:45
Git Aliases
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# View the current working tree status using the short format
s = status -s
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
@NigelThorne
NigelThorne / karabiner.json
Last active June 29, 2020 02:06 — forked from ttscoff/karabiner.json
Karabiner Elements hyper key with escape
"complex_modifications": {
"rules": [
{
"manipulators": [
{
"description": "Change caps_lock to command+control+option+shift. Escape if no other key used.",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
@NigelThorne
NigelThorne / gen_jira.rb
Last active February 17, 2020 01:05
Generate issues in Jira from a list
require 'rubygems'
require 'jira-ruby'
require 'awesome_print'
def get_jira_client()
options = {
:username => 'xxx',
:password => 'xxx',
:site => 'http://jira.xxx:80/',#'http://mydomain.atlassian.net:443/',
@NigelThorne
NigelThorne / active_window_boarder.ahk
Created September 20, 2019 06:48
Highlight Active window in windows - using AHK
#Persistent
SetTitleMatchMode, 2
SetTitleMatchMode, Fast
SetTimer, DrawRect, 50
border_thickness = 20
HideTime := A_TickCount
offset := 0
@NigelThorne
NigelThorne / everything.el
Created March 22, 2019 03:59
EmacsLisp to add everything search engine to emacs (https://www.emacswiki.org/emacs/Everything)
;;; everything.el --- Bridge to MS Windows desktop-search engine Everything
;; Copyright (C) 2012 Martin Weinig
;; Author: Martin Weinig <mokkaee@gmail.com>
;; Keywords: tools,windows,files,searching
;; Version: 0.1.5
;; Filename: everything.el
;; Compatibility: GNU Emacs 23.x