Skip to content

Instantly share code, notes, and snippets.

View don-smith's full-sized avatar
🧘

Don Smith don-smith

🧘
  • HYPR
  • Tākaka, NZ
View GitHub Profile
@don-smith
don-smith / app.coffee
Created September 30, 2012 06:28
Facebook authentication using EveryAuth 0.2.34 (prerelease: express3 branch) with Express.js 3.0.0rc4
facebook = require './facebook'
mongoose = require 'mongoose'
express = require 'express'
routes = require './routes'
http = require 'http'
path = require 'path'
app = express()
app.configure ->
app.set 'port', process.env.PORT || 3000
@don-smith
don-smith / meteor-dump.sh
Last active January 18, 2021 03:17 — forked from olizilla/meteor-dump.sh
A couple of shell scripts to dump and restore production Meteor (MongoDB) databases.
#!/bin/bash
# __
# _____ ____ _/ |_ ____ ____ _______
# / \ _/ __ \ \ __\_/ __ \ / _ \ \_ __ \
# | Y Y \\ ___/ | | \ ___/ ( <_> ) | | \/
# |__|_| / \___ > |__| \___ > \____/ |__|
# \/ \/ \/
#
# .___
# __| _/ __ __ _____ ______
@don-smith
don-smith / README.md
Last active January 3, 2016 02:18 — forked from syntagmatic/README.md
Early cell splitting concept
@don-smith
don-smith / README.md
Last active January 3, 2016 02:29 — forked from syntagmatic/README.md
Force directed cell splitting

Links being severed over time inside of a convex hull

@don-smith
don-smith / default.html
Created February 24, 2014 02:28
An illustration of structuring a WinJS app for better JavaScript modularity. See [link] for more information.
<!DOCTYPE html>
<!-- Content forthcoming -->
@don-smith
don-smith / Relocate.ps1
Created March 25, 2015 08:26
PowerShell script to copy a VM from one Azure subscription to another one
# Gratefully borrowed and edited from
# http://blogs.msdn.com/b/microsoft_press/archive/2014/01/29/from-the-mvps-copying-a-virtual-machine-from-one-windows-azure-subscription-to-another-with-powershell.aspx
# Source VM
$sourceSubscriptionName = "Name of the source subscription"
$destSubscriptionName = "Name of the destination subscription"
Get-AzureVM
$vmName = "name-of-source-vm"
@don-smith
don-smith / neurons.r
Created April 1, 2015 09:59
Perceptron and Sigmoid neuron behaviour
library(ggplot2)
# calculates the output of a sigmoid neuron
# given the denormalized result of a perceptron
sigmoidize <- function(z) {
1 / (1+exp(-z))
}
# normalizes the value of a perceptron
normalize <- function(input) {
/**
* Originally created in JS Bin: http://jsbin.com/yetubi/edit?js,console
* Dependencies: lodash
*
* This script finds 4 whole number values that have a specific relationship.
* Specifically, the sum of the squares of 3 numbers when they equal the
* square root of the 4th number. In linear algebra terms, this calculates
* the absolute value of a vector [x, y, z] when all values and the result
* are whole numbers. This formula is also known to calculate the distance
* of a 3D point from zero: d = sqrt(x*x + y*y + z*z)
@don-smith
don-smith / synaptics.conf
Last active October 14, 2015 01:43
My trackpad settings in Debian 8 on my ASUS ZenBook (UX303LA)
# /etc/X11/xorg.conf.d/synaptics.conf
# More info: http://www.x.org/archive/X11R7.5/doc/man/man4/synaptics.4.html
Section "InputClass"
Identifier "Touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Option "TapButton1" "1" # left click
Option "TapButton2" "3" # right click
Option "TapButton3" "2" # middle click
! ~/.Xmodmap
! Activate with xmodmap ~/.Xmodmap
!
! Enable natural scrolling (horizonal and vertical)
!
pointer = 1 2 3 5 4 7 6 9 8 10 11 12
!
! Swap Caps_Lock and Control_L