Skip to content

Instantly share code, notes, and snippets.

View jrwren's full-sized avatar
๐Ÿ’ญ
๐Ÿคฏ๐Ÿ’ฏ๐Ÿ‘๐Ÿ”ฅ๐ŸŽ‰๐Ÿคทโ€โ™€๏ธ๐Ÿ˜๐Ÿ˜•๐Ÿ•ด๐Ÿฝ๐Ÿ˜ต๐Ÿ˜ž๐Ÿค•๐Ÿคฎ

Jay R. Wren jrwren

๐Ÿ’ญ
๐Ÿคฏ๐Ÿ’ฏ๐Ÿ‘๐Ÿ”ฅ๐ŸŽ‰๐Ÿคทโ€โ™€๏ธ๐Ÿ˜๐Ÿ˜•๐Ÿ•ด๐Ÿฝ๐Ÿ˜ต๐Ÿ˜ž๐Ÿค•๐Ÿคฎ
View GitHub Profile
@tj
tj / main.go
Last active April 10, 2017 06:58
package main
import (
"fmt"
"net/http"
"github.com/apex/go-apex"
"github.com/apex/go-apex/proxy"
)
#!/bin/bash
#
# This script will create xenial and trusty lxd images that will be used by the
# lxd provider in juju 2.1+ It is for use with the lxd provider for local
# development and preinstalls a common set of production packages.
#
# This is important, as between them, basenode and layer-basic install ~111
# packages, before we even get to any packages installed by your charm.
#
# It also installs some helpful development tools, and pre-downloads some
@nathforge
nathforge / expbackoff.sh
Created December 22, 2016 10:33
Exponential backoff in Bash
expbackoff() {
# Exponential backoff: retries a command upon failure, scaling up the delay between retries.
# Example: "expbackoff my_command --with --some --args --maybe"
local MAX_RETRIES=${EXPBACKOFF_MAX_RETRIES:-8} # Max number of retries
local BASE=${EXPBACKOFF_BASE:-1} # Base value for backoff calculation
local MAX=${EXPBACKOFF_MAX:-300} # Max value for backoff calculation
local FAILURES=0
while ! "$@"; do
FAILURES=$(( $FAILURES + 1 ))
if (( $FAILURES > $MAX_RETRIES )); then
@ericoporto
ericoporto / firstsnapexperience.md
Last active December 6, 2017 22:37
Trying to build a Snap for the first time

#My Notes on My First Snap Building Experience

Hi, I wanted to try building a Snap package, so from my experiment thought on leave what my wandering left me, lot's of this content is from the Ubuntu Desktop Developer website . The website has a nice getting started too! .

@Avaq
Avaq / combinators.js
Last active May 20, 2025 01:53
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@kangax
kangax / quicksort.hs
Last active September 5, 2021 19:44
Haskell-inspired quick sort in ES6
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smallerSorted = quicksort (filter (<=x) xs)
biggerSorted = quicksort (filter (>x) xs)
in smallerSorted ++ [x] ++ biggerSorted
@dragonfax
dragonfax / main.go
Created August 28, 2015 01:24
simple client to access Riak CS using aws-sdk-go
package main
import (
"bytes"
"fmt"
"io/ioutil"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/service/s3"
@searls
searls / github-wiki-override-test-double-style.css
Last active May 11, 2021 16:33
Some CSS that will make Github Wiki content full-screen friendly (useful when presenting). Override with your browser or an extension like greasemonkey or Stylish to apply to the wikis you want.
/* and now with 100% more branding */
body { border: 10px solid #82FA32; min-height: 720px; }
.container { width: inherit; }
.header { display: none; }
.gh-header { padding: 30px 0px 30px 0px; background-color: black; color: white; }
.gh-header-actions { float: inherit; text-align: center; }
.btn-primary { border-color: #000; background-image: linear-gradient(#333, #000); }
.gh-header-actions .btn { float: inherit; }
.gh-header-title { padding-top: 20px; text-align: center; font-size: 4.2em; margin-right: 0px; font-weight: 100; }
.pagehead { display: none; }
@DomSless
DomSless / KodiSendURL.html
Last active September 15, 2021 20:48
Quick, Dirty 'n' Hacky Method to Send Video URL's to Kodi/XBMC
<!DOCTYPE html>
<html lang=โ€enโ€>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
Enter URL:
<input type="text" style="width: 300px;" value="http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi">
<button>Send..</button>
</br></br>
@paulirish
paulirish / bling.js
Last active May 26, 2025 20:31
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };