Skip to content

Instantly share code, notes, and snippets.

@chrisns
chrisns / install-k8s.ps1
Last active May 8, 2018 22:33
Install k8s and everything we need for a workshop
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y atom
choco install -y bash --source cygwin
choco install -y curl
choco install -y docker
choco install -y docker-machine
choco install -y firefox
choco install -y git
choco install -y googlechrome
DEVICE=INTERFACE
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
@chrisns
chrisns / updateSecret.sh
Last active January 14, 2020 12:35 — forked from 6be709c0/updateSecret.sh
A simple command to finally update the docker secret !
#!/usr/bin/env bash
# HOW TO USE
# based on https://gist.github.com/MLescaudron/e8248d32d3a5b8caaf622c1a829cf067
# ./updateSecret.sh secretName newFile
# It's that simple !
if [ "$#" -ne 2 ];
then
echo "#####"
@chrisns
chrisns / keybase.md
Created September 1, 2016 18:05
keybase.md

Keybase proof

I hereby claim:

  • I am chrisns on github.
  • I am chrisns (https://keybase.io/chrisns) on keybase.
  • I have a public key whose fingerprint is 0CA7 788D F20B 665C 3934 6704 B342 25DF 4F8C 89E0

To claim this, I am signing this object:

JS technical test

Scope

Consider the following code:

var a = b = 5;
console.log(b);

What will be printed on the console?

@chrisns
chrisns / tcmessages.py
Created June 26, 2014 17:06
pycharm tcmessages.py fix
import sys
class TeamcityServiceMessages:
quote = {"'": "|'", "|": "||", "\n": "|n", "\r": "|r", ']': '|]'}
messages = []
def __init__(self, output=sys.stdout, prepend_linebreak=False, buffer_output=True):
self.output = output
self.prepend_linebreak = prepend_linebreak
self.buffer_output = buffer_output
@chrisns
chrisns / playlist.js
Created December 19, 2013 16:20
transittours example playlist
{
"location1": {
"lon": 12,
"lat": 30,
"radius": 10, // distance in km
"playlist" : {
"audiofile1":null,
"audiofile2":null
}
},
@chrisns
chrisns / ticker.py
Created December 18, 2013 14:38
btc/ltc/usd ticker
#!/usr/bin/env python
# Based on the Gmail appindicator from
# http://conjurecode.com/create-indicator-applet-for-ubuntu-unity-with-python/
import sys
import os
import gtk
import appindicator
import requests
@chrisns
chrisns / cgminer.conf
Last active July 26, 2016 11:30
mining config
{
"pools": [
{
"url": "stratum+tcp://eu.multipool.us:7777",
"user": "chrisns.HOSTNAME",
"pass": "x"
},
{
"url": "stratum+tcp://eu2.multipool.us:7777",
"user": "chrisns.HOSTNAME",
@chrisns
chrisns / codecoverage.patch
Created November 8, 2012 14:44
drupal 7 codecoverage patch
diff --git includes/bootstrap.inc includes/bootstrap.inc
index 74853b2..282a232 100644
--- includes/bootstrap.inc
+++ includes/bootstrap.inc
@@ -3383,3 +3383,52 @@ function _drupal_shutdown_function() {
}
}
}
+
+