Skip to content

Instantly share code, notes, and snippets.

View blacksun1's full-sized avatar

Simon Bruce blacksun1

  • Adelaide, Australia
View GitHub Profile
@blacksun1
blacksun1 / keybase.md
Created February 17, 2015 06:41
keybase.md

Keybase proof

I hereby claim:

  • I am blacksun1 on github.
  • I am blacksun1 (https://keybase.io/blacksun1) on keybase.
  • I have a public key whose fingerprint is F182 65EC 3203 B6CA BCE0 2643 E55F 84FD D58F 8136

To claim this, I am signing this object:

function Get-UsersFullName {
$NAME_DISPLAY = [int] 3
$MethodDefinition = @'
[DllImport("secur32.dll", CharSet=CharSet.Auto, SetLastError=true)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern int GetUserNameEx (int nameFormat, StringBuilder userName, ref UInt32 userNameSize);
'@
$type = Add-Type -MemberDefinition $MethodDefinition `
-NameSpace Win32 -Name "Secur32" `
-Using "System.Text" -PassThru
@blacksun1
blacksun1 / index.js
Created March 31, 2015 21:53
Very simple test of Handlebars and Nodejs
var Handlebars = require('handlebars'),
assert = require('assert'),
templateSource = '<h1>{{title}}</h1>',
template = Handlebars.compile(templateSource),
data = { title: 'I like cake' },
result = template(data);
assert.equal(result, '<h1>I like cake</h1>');
console.log('All good mate.');
#requires -version 2
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
"use strict";
const Q = require("q");
Q.async(function*(){
let promiseResults = [];
try {
promiseResults.push([new Date(), yield Q.resolve("Done?")]);
promiseResults.push([new Date(), yield(Q.delay("Done 1", 1000))]);
@blacksun1
blacksun1 / brokenTest.js
Last active September 7, 2016 13:33
Lab test for using
'use strict';
// Load modules
const Lab = require('lab');
// Test shortcuts
# WELCOME TO SQUID 3.5.12
# ----------------------------
#
# This is the documentation for the Squid configuration file.
# This documentation can also be found online at:
# http://www.squid-cache.org/Doc/config/
#
# You may wish to look at the Squid home page and wiki for the
# FAQ and other documentation:
# http://www.squid-cache.org/

Raspberry pi changes

Rotate screen (and touchscreen)

Append to /boot/config.txt

lcd_rotate=2
#!/bin/zsh
# NVM
export NVM_DIR="/home/simon/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# CDGIT!
function cdgit() {
@blacksun1
blacksun1 / rejected.json
Last active January 29, 2020 04:14
Webhooks
{
"code": "REJECTED",
"rejectionMessage": "Webhook rejection message to be displayed to visitor"
}