Skip to content

Instantly share code, notes, and snippets.

Avatar
Hmmm, breakfast

Steve Bentley tophatsteve

Hmmm, breakfast
View GitHub Profile
View Rust travis.yml
sudo: required
language: rust
# Cache cargo symbols for faster build
cache: cargo
# Dependencies of kcov, used by coverage
addons:
apt:
packages:
View BaltimoreRootCertificate.cer
-----BEGIN CERTIFICATE-----
MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ
RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD
VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX
DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y
ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy
VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr
mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr
IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK
mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu
@tophatsteve
tophatsteve / go.json
Created Mar 6, 2017
VS Code Go Snippets
View go.json
{
"Read from Stdin": {
"prefix": "scan",
"body": [
"s := bufio.NewScanner(os.Stdin)",
"for s.Scan() {",
" $1",
"}"
],
@tophatsteve
tophatsteve / web.config
Created Mar 3, 2014
Force PDFs to always download rather than open in brower
View web.config
<system.webServer>
<!-- other system.webServer stuff -->
<rewrite>
<outboundRules>
<rule name="Forcing Download for PDFs" preCondition="IsPDF">
<match serverVariable="RESPONSE_Content-Disposition" pattern=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" pattern="(.*)\\([^/]+)\.pdf$" />
@tophatsteve
tophatsteve / AddScheduledTask.ps1
Created Nov 2, 2012
Add a scheduled task from an XML template file
View AddScheduledTask.ps1
#
# Customise the XML used to create a scheduled task, then create the task.
#
function Get-Script-Directory
{
$scriptInvocation = (Get-Variable MyInvocation -Scope 1).Value
return Split-Path $scriptInvocation.MyCommand.Path
}
@tophatsteve
tophatsteve / control-ie.ps1
Created Jun 12, 2012
Control Internet Explorer with Powershell
View control-ie.ps1
$ie = new-object -com "InternetExplorer.Application"
$ie.visible = $true
$ie.navigate("http://localhost/Default.aspx")
$doc = $ie.document
$link = $doc.getElementByID("link_01")
$link.click()
@tophatsteve
tophatsteve / GenerateFunction.ps1
Created Jun 7, 2012
Dymanically generate a function in Powershell
View GenerateFunction.ps1
function GenerateFunction($functionName, $codeBlock)
{
$argList = ""
foreach($argName in $args)
{
if($argList.Length -gt 0)
{
$argList += ","
}
@tophatsteve
tophatsteve / classfactory.ps1
Created Jun 7, 2012
Powershell class factory
View classfactory.ps1
function ClassFactory(){
$object = New-Module {
$myField = 5
function xTimesMyField($x) {
$x * $myField
}
Export-ModuleMember -Variable * -Function *
} -asCustomObject
return $object
}
@tophatsteve
tophatsteve / mapred-site.xml
Created May 22, 2012
MapReduce config file for Hadoop 0.22.0 on Windows with Cygwin
View mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>hdfs://localhost:9001</value>
</property>
<property>
<name>mapred.map.child.java.opts</name>
<value>-Xmx512M</value>
</property>
<property>