Skip to content

Instantly share code, notes, and snippets.

View ishepherd's full-sized avatar
😃
(╯°□°)╯︵ ┻━┻

Iain Shepherd ishepherd

😃
(╯°□°)╯︵ ┻━┻
View GitHub Profile
@stober
stober / softmax.py
Created March 1, 2012 03:05
Softmax in Python
#! /usr/bin/env python
"""
Author: Jeremy M. Stober
Program: SOFTMAX.PY
Date: Wednesday, February 29 2012
Description: Simple softmax function.
"""
import numpy as np
npa = np.array
@ryanoneill
ryanoneill / Problem08.scala
Created April 3, 2012 19:48
Ninety-Nine Scala Problems: Problem 08 - Eliminate consecutive duplicates of list elements.
// http://aperiodic.net/phil/scala/s-99/
// P08 (**) Eliminate consecutive duplicates of list elements.
// If a list contains repeated elements they should be replaced with a single copy of the element. The order of the elements should not be changed.
// Example:
// scala> compress(List('a, 'a, 'a, 'a, 'b, 'c, 'c, 'a, 'a, 'd, 'e, 'e, 'e, 'e))
// res0: List[Symbol] = List('a, 'b, 'c, 'a, 'd, 'e)
object Problem08 {
@magnetikonline
magnetikonline / README.md
Last active February 21, 2023 15:03
PowerShell Import-Module with .ps1 quirk.

PowerShell Import-Module with .ps1 quirk

Well, not so much a quirk - but an interesting anti-pattern I found in some (poor quality) PowerShell. Documenting the "how and why" so I can refer to it again if needed!

Example

@abayer
abayer / Jenkinsfile
Created February 15, 2017 15:17
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@ShridharParameshwarBhat
ShridharParameshwarBhat / GenerateBEKFileForDiskUnlock.ps1
Last active February 23, 2022 22:33
This is the script to generate the BEK file for unlocking the encrypted disk
Param(
[Parameter(Mandatory = $true,
HelpMessage="URL of the secret stored in the keyvault")]
[ValidateNotNullOrEmpty()]
[string]$secretUrl,
[Parameter(Mandatory = $true,
HelpMessage="Resource group of keyvault")]
[ValidateNotNullOrEmpty()]
[string]$keyVaultResourceGroup,
@magnetikonline
magnetikonline / README.md
Last active June 5, 2024 02:43
Install AWS CLI v2 from source.

Install AWS CLI v2 from source

Bash script to install the latest released version of the AWS CLI v2 from the distrubuted source.

Using this method to exectue the CLI under a MacBook M1 laptop as a native ARM binary - rather than falling back to Rosetta. Currently the offically packaged macOS .pkg doesn't support both Intel/M1 architectures.

Script designed to be re-run - will blow away an existing install and re-install the latest available version.

Note

This install script assumes you have installed a suitable version of Python 3 - has been tested against Python 3.10.11 under macOS Sonoma v14.4.1.