Skip to content

Instantly share code, notes, and snippets.

View tophatsteve's full-sized avatar
Hmmm, breakfast

Steve Bentley tophatsteve

Hmmm, breakfast
View GitHub Profile
sudo: required
language: rust
# Cache cargo symbols for faster build
cache: cargo
# Dependencies of kcov, used by coverage
addons:
apt:
packages:
-----BEGIN CERTIFICATE-----
MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ
RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD
VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX
DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y
ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy
VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr
mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr
IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK
mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu
@tophatsteve
tophatsteve / go.json
Created March 6, 2017 08:54
VS Code Go Snippets
{
"Read from Stdin": {
"prefix": "scan",
"body": [
"s := bufio.NewScanner(os.Stdin)",
"for s.Scan() {",
" $1",
"}"
],
@tophatsteve
tophatsteve / web.config
Created March 3, 2014 08:42
Force PDFs to always download rather than open in brower
<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 November 2, 2012 10:34
Add a scheduled task from an XML template file
#
# 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 June 12, 2012 10:49
Control Internet Explorer with Powershell
$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 June 7, 2012 13:20
Dymanically generate a function in Powershell
function GenerateFunction($functionName, $codeBlock)
{
$argList = ""
foreach($argName in $args)
{
if($argList.Length -gt 0)
{
$argList += ","
}
@tophatsteve
tophatsteve / classfactory.ps1
Created June 7, 2012 12:55
Powershell class factory
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 15:11
MapReduce config file for Hadoop 0.22.0 on Windows with Cygwin
<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>