Skip to content

Instantly share code, notes, and snippets.

View sbennettmcleish's full-sized avatar

Scott Bennett-McLeish sbennettmcleish

View GitHub Profile
@sbennettmcleish
sbennettmcleish / cidr.yml
Last active March 19, 2018 09:56
Cloudformation Cidr function
SubnetExtA:
Type: AWS::EC2::Subnet
DependsOn: VpcCidrBlockIpv6
Properties:
CidrBlock:
!Select: [0, !Cidr [ !Ref "VpcCidr", "256", "8" ]]
Ipv6CidrBlock:
!Select: [0, !Cidr [ !Select [ 0, !GetAtt ["VPC", "Ipv6CiderBlocks"], "256", "64" ]]]
AssignIpv6AddressOnCreation: "true"
AvailabilityZone: !Join [ "", [ !Ref "AWS::Region", "a" ]]
@sbennettmcleish
sbennettmcleish / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@echo off
SET st3Path=F:\Dropbox\Tools\Sublime Text 3 [Build 3065 x64]\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3 (beta)" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3 (beta)" /f
@sbennettmcleish
sbennettmcleish / gist:3232241
Created August 2, 2012 01:20 — forked from swannodette/gist:3217582
sudoku_compact.clj
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
(defn init [vars hints]