Skip to content

Instantly share code, notes, and snippets.

View Lewiscowles1986's full-sized avatar
🤓

Lewis Cowles Lewiscowles1986

🤓
View GitHub Profile

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.

@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
node {
try{
notifyBuild('STARTED')
bitbucketStatusNotify(buildState: 'INPROGRESS')
ws("${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/") {
withEnv(["GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}"]) {
env.PATH="${GOPATH}/bin:$PATH"
stage('Checkout'){
@alexellis
alexellis / k8s-pi.md
Last active April 11, 2024 14:17
K8s on Raspbian
@Lewiscowles1986
Lewiscowles1986 / dhcpcd.sh
Created August 21, 2017 16:00
Raspberry pi stretch allow dhcpcd5 with /etc/network/interfaces
#!/bin/sh -e
#
# This file belongs in /usr/lib/dhcpcd5/dhcpcd how you get it there is up to you
#
DHCPCD=/sbin/dhcpcd
INTERFACES=/etc/network/interfaces
REGEX="^[[:space:]]*iface[[:space:]](*.*)[[:space:]]*inet[[:space:]]*(dhcp|static)"
EXCLUDES=""
@honktang
honktang / web-snippet-055 ( upload to Imgur in JavaScript)
Created June 14, 2017 06:14 — forked from achudars/web-snippet-055 ( upload to Imgur in JavaScript)
Use JavaScript to upload anonymously to Imgur using Imgur API and show the link to the file. Make sure your API key is valid and working!
function upload(file) {
var imageLink ="";
/* Is the file an image? */
if (!file || !file.type.match(/image.*/)) return;
var fd = new FormData();
fd.append("image", file); // Append the file
fd.append("key", "<Imgur API key>");
@mmcdaris
mmcdaris / R2G_to_local.md
Created March 21, 2017 22:09
Replicate from REDISTOGO to your local machine

example RTG_URL: redis://username:secretpasswordfromtheurl@lab.redistogo.com:9555/

Step 1: Start a local redis-server and redis-cli

$ redis-server
#in a new tab run:
$ redis-cli
@freekmurze
freekmurze / curry.php
Created December 17, 2016 20:51
curry.php
<?php
function curry($f, $argument)
{
return function (...$arguments) use ($f, $argument) {
return $f(...array_merge([$argument], $arguments));
};
}
function add(...$numbers)
@ffoodd
ffoodd / improved-sr-only.markdown
Last active May 3, 2024 15:23
Improved .sr-only

Improved .sr-only

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@denniswebb
denniswebb / swagger-ui.tf
Created October 11, 2016 02:55
Terraform template for deploying Swagger-UI to S3 website.
variable "region" {default = "us-west-2"}
variable "website_dns" {default = "swagger-ui.webblab.info"}
variable "r53_zone_id" {default = "Z1S59LUERGUH56"}
variable "swagger_ui_version" {default = "v2.2.5"}
provider "aws" {
region = "${var.region}"
}
resource "aws_s3_bucket" "main" {