Skip to content

Instantly share code, notes, and snippets.

Lewis Cowles Lewiscowles1986

Block or report user

Report or block Lewiscowles1986

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@freekmurze
freekmurze / bookmarklet
Last active Feb 22, 2019
Oh Dear! Reachable bookmarklet
View bookmarklet
javascript:{window.location='https://ohdear.app/tools/reachable?prefill='+encodeURIComponent(window.location.href)}
View freeze.md

Freezer cgroup FTW

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.

@jessfraz
jessfraz / boxstarter.ps1
Last active Jul 9, 2019
Boxstarter Commands for a new Windows box.
View boxstarter.ps1
# 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:
View Jenkinsfile
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 Jul 15, 2019
K8s on Raspbian
View k8s-pi.md
@Lewiscowles1986
Lewiscowles1986 / dhcpcd.sh
Created Aug 21, 2017
Raspberry pi stretch allow dhcpcd5 with /etc/network/interfaces
View dhcpcd.sh
#!/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 Jun 14, 2017 — 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!
View web-snippet-055 ( upload to Imgur in JavaScript)
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>");
View curry.php
<?php
function curry($f, $argument)
{
return function (...$arguments) use ($f, $argument) {
return $f(...array_merge([$argument], $arguments));
};
}
function add(...$numbers)
@denniswebb
denniswebb / swagger-ui.tf
Created Oct 11, 2016
Terraform template for deploying Swagger-UI to S3 website.
View swagger-ui.tf
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" {
@Sayan98
Sayan98 / USAGE.md
Last active Oct 23, 2016
Python basic time profiler
View USAGE.md

To use the profiler, just use import pyprofile and if the function to be profiled is named stupid_code use the profiler as follows

@pyprofile
def stupid_code():
    # do something stupid here
You can’t perform that action at this time.