Skip to content

Instantly share code, notes, and snippets.

@markstinson
markstinson / tm_to_subl.rb
Created June 5, 2012 04:07 — forked from sandboxws/tm_to_subl.rb
Convert TextMate snippets to Sublime Text 2 snippets
require 'nokogiri'
require 'fileutils'
require 'active_support/inflector'
def friendly_filename(filename)
filename.gsub(/[^\w\s_-]+/, '')
.gsub(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2')
.gsub(/\s/, '_')
end
@markstinson
markstinson / server.js
Created June 18, 2012 17:00 — forked from mixonic/server.js
Node.js + Socket.io + Bash. A collaborative terminal for your browser.
//
// This server will start a bash shell and expose it
// over socket.io to a browser. See ./term.html for the
// client side.
//
// You should probably:
//
// npm install socket.io
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js
//
Host *
ForwardAgent yes
ProxyCommand ~/bin/ssh-proxy.sh %h %p username@jump-host
ServerAliveInterval 10
ServerAliveCountMax 600
@markstinson
markstinson / set-LVDS1-scale
Created February 9, 2013 17:09
script to change x11 scaling to fit on Dell Mini 9 screen
#!/bin/bash
foo=`xrandr | grep LVDS`
lvds=`echo $foo | cut -d' ' -f1`
size=`echo $foo | cut -d' ' -f3`
if [ $1 ]
then
xrandr --output $lvds --mode 1024x600 --scale ${1}x${1}
elif [ $2 ]
@markstinson
markstinson / SftpServiceTest.java
Created April 6, 2016 01:01 — forked from ToastShaman/SftpServiceTest.java
Using an embedded Apache MINA SSHD server in a unit test to verify that your code is able to upload a file through SFTP. This unit tests uses JSch as the client to speak to an embedded Apache MINA sftp server and verifies that the upload of a text file was successful.
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
@markstinson
markstinson / learn.lua
Created August 14, 2016 06:55 — forked from tylerneylon/learn.lua
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------

Keybase proof

I hereby claim:

  • I am markstinson on github.
  • I am markstinson (https://keybase.io/markstinson) on keybase.
  • I have a public key whose fingerprint is 4AE8 451E 2B14 EAC4 B438 9790 7664 0C31 58AC D8CB

To claim this, I am signing this object:

@markstinson
markstinson / indieroyale.user.js
Last active December 6, 2016 03:14 — forked from mikemanger/indieroyale.user.js
Indie Royal Collection Labeler
// ==UserScript==
// @name Indie Royale Bundle Labeler
// @include http://www.indieroyale.com/collection
// @updateURL https://gist.githubusercontent.com/markstinson/1606fa532246cb6d231d4719db03cebc/raw
// @downloadURL https://gist.githubusercontent.com/markstinson/1606fa532246cb6d231d4719db03cebc/raw
// @grant none
// @version 1.3.1
// ==/UserScript==
// update with your username/checksum
@markstinson
markstinson / humble-bundle-key-cache.user.js
Last active December 6, 2016 03:14 — forked from mikemanger/humble-bundle-key-cache.user.js
Caches your Humble bundle key list
// ==UserScript==
// @name Humble Bundle key cache
// @include https://www.humblebundle.com/home*
// @updateURL https://gist.githubusercontent.com/markstinson/eb377c2c21b3b14c5676d375f619bdad/raw
// @downloadURL https://gist.githubusercontent.com/markstinson/eb377c2c21b3b14c5676d375f619bdad/raw
// @grant GM_setValue
// @grant GM_getValue
// @run-at document-end
// @version 1.1.4
// ==/UserScript==
@markstinson
markstinson / desura-game-labeler.user.js
Last active December 6, 2016 03:18 — forked from mikemanger/desura-game-labeler.user.js
Displays titles on your Desura collection page
// ==UserScript==
// @name Desura Game Labeler
// @include http://www.desura.com/collection
// @updateURL https://gist.githubusercontent.com/markstinson/60fc05a31360e177283253237fa4c59a/raw
// @downloadURL https://gist.githubusercontent.com/markstinson/60fc05a31360e177283253237fa4c59a/raw
// @require https://gist.githubusercontent.com/markstinson/cbe66b990811db3346caab8eb2b39ef8/raw
// @grant none
// @version 1.2.2
// ==/UserScript==