Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
echo '==> Downloading installer...'
curl -L -O https://aka.ms/vs/15/release/vs_professional.exe
echo '==> Updating...'
./vs_professional.exe update --quiet --norestart --wait --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional"
@pearswj
pearswj / sfb.py
Created September 12, 2017 10:16
#!/usr/bin/env python
from datetime import datetime
import os
import requests
from slackclient import SlackClient
import time
slack_token = os.environ["SLACK_API_TOKEN"]
sc = SlackClient(slack_token)
@pearswj
pearswj / hubot-errors.coffee
Last active January 12, 2017 14:05
Example adding custom error handlers to hubot and the built-in express server
ERROR_ROOM = process.env.HUBOT_ERROR_ROOM
module.exports = (robot) ->
# Handles unhandled exceptions
#
# Returns nothing.
robot.error (err, msg) ->
# if appropriate, reply to the user
if msg? and msg.envelope.room != ERROR_ROOM
@pearswj
pearswj / data.tsv
Created June 7, 2016 19:45
Area chart for visualising open/closed issues
date resolved unresolved
20111001 63.4 62.7
20111002 58.0 59.9
20111003 53.3 59.1
20111004 55.7 58.8
20111005 64.2 58.7
20111006 58.8 57.0
20111007 57.9 56.7
20111008 61.8 56.8
20111009 69.3 56.7
@pearswj
pearswj / mac.sh
Created November 13, 2015 16:57
A couple of simple scripts to handle the cloning/checking out of source from Git for CI.
if [ ! -d "./.git" ]; then
git init
git remote add origin git://github.com/Dan-Piker/Plankton
git config --add remote.origin.fetch "+refs/pull/*/merge:refs/remotes/origin/pull/*/merge"
fi
git fetch -q origin
git reset -q --hard $JANKY_SHA1
if [ -f script/cibuild ]; then
script/cibuild
else
@pearswj
pearswj / Edge.java
Last active September 11, 2015 09:45
Classes from an old processing library project for modelling manifold n-gon meshes.
/**
*
*/
package manifold;
import processing.core.*;
/**
* a class for edges
*/
@pearswj
pearswj / externals.py
Created September 9, 2015 10:22
Recursively lists svn externals and their revisions.
#!/bin/env python
"""
externals.py
~~~~~~~~~~~~
Usage: `externals.py https://svn-server/repository`
`externals.py file:///svn/repository`
`externals.py working/copy`
This script was inspired by from http://stackoverflow.com/a/10286163/2464295.
I am a CLA.
import rhinoscriptsyntax as rs
import scriptcontext
import Rhino.Commands.Result as res
def arraylayers():
prefix = rs.GetString("Prefix for layers to array", "A")
X = rs.GetReal()
Y = rs.GetReal()
Z = rs.GetReal()
@pearswj
pearswj / meshCurvatureTensors.py
Created October 25, 2013 07:58
A RhinoPython script which computes the principal curvature directions at any given vertex on a mesh.
import Rhino
import scriptcontext
import System.Guid
#import System.Drawing
import math
from matrix import Matrix
def Torus(R, r, toroidal, poloidal):
"""Returns a parametrically constructs a torus mesh."""
mesh = Rhino.Geometry.Mesh()