Skip to content

Instantly share code, notes, and snippets.

View mediaupstream's full-sized avatar
🍉

Derek Anderson mediaupstream

🍉
View GitHub Profile
@mediaupstream
mediaupstream / make_certs.sh
Last active April 5, 2024 19:22
extract ca-certs, key, and crt from a pfx file
#!/bin/bash
#
# Usage:
# ./make_certs.sh test.example.com
#
# The required input to make_certs.sh is the path to your pfx file without the .pfx prefix
#
# test.example.com.key
# test.example.com.crt (includes ca-certs)
body.night-mode {
-webkit-filter: invert(100%) hue-rotate(30deg) contrast(70%) brightness(80%);
filter: invert(100%) hue-rotate(30deg) contrast(70%) brightness(80%);
}
@mediaupstream
mediaupstream / response.json
Last active July 3, 2017 16:29
upload files response
[
{
"id": "f0717a2d-b66c-4441-ba8c-0300f9fd8ce5",
"filename": "foobar.txt",
"hash": "6a204bd89f3c8348afd5c77c717a097a",
"url": "/cool/folder/foobar.txt",
...
},
{
"id": "dc063f16-f00a-4d7a-9463-2168f5ecd8b0",
@mediaupstream
mediaupstream / vhost-thing.conf
Last active June 9, 2017 19:38
vhost-thing.conf
server {
#
# Depending on your version of nginx you can use http/2 for all
# requests. This will speed things up for sure!
#
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/nginx/cert/northernspark.com.certchain.crt;
ssl_certificate_key /etc/nginx/cert/northernspark.com.key;
@mediaupstream
mediaupstream / base64.js
Last active May 16, 2017 18:16
node.js base64 class
/**
* Base64 encode / decode strings, objects, arrays, etc
*/
class base64 {
static encode (data) {
return new Buffer(JSON.stringify(data)).toString('base64')
}
static decode (data) {
return JSON.parse( new Buffer(data, 'base64').toString() )
}
Media Upstream Terms of Service and Privacy Policy
1. Terms
By accessing the website at http://mediaupstream.com, you are agreeing to be bound by these terms of service, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this website are protected by applicable copyright and trademark law.
2. Use License
Permission is granted to temporarily download one copy of the materials (information or software) on Media Upstream's website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not:
modify or copy the materials;
@mediaupstream
mediaupstream / p5js-screensaver.js
Created January 14, 2017 02:18
inspired by screensaver
'use strict';
var rgb = []
var points = []
var pause = false
var _alpha = 1;
function P(){
this.x = floor(random(100, windowWidth-100))
this.y = floor(random(100, windowHeight-100))
javascript:(function(){if(typeof jQuery=='undefined'){var jQ=document.createElement('script');jQ.type='text/javascript';jQ.onload=bookmarklet;jQ.src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';document.body.appendChild(jQ);}else{bookmarklet();}function bookmarklet(){(function($){var LOLTranslate=function(h,g){var g=(typeof g==="undefined"||g==true)?true:false;var j="";var m={"i can have":"i can has","oh really":"orly",seriously:"srsly",uestion:"wesjun",unless:"unles",really:["rly","rily","rilly","rilley"],"you're":["yore","yr"],buddah:"ceiling cat",kitten:"kitteh",cture:"kshur",esque:"esk",tious:"shus",thank:["fank","tank","thx","thnx"],world:["wurrld","whirld","wurld","wrld"],hello:"oh hai",howdy:"oh hai",allah:"ceiling cat",diety:"ceiling cat",kitty:"kitteh","this":"thiz",eady:"eddy",what:["wut","whut"],more:"moar",sion:"shun",just:"jus",want:"waants",eese:"eez",ucke:["ukki","ukke"],sion:"shun",like:["likes","liek"],love:["loves","lub","lubs","luv"],outh:"owf",scio:"shu",ture:"chur",sure:"
@mediaupstream
mediaupstream / linked_list.js
Created January 19, 2016 23:01
Algorithms in JavaScript
function Node(data, next){
this.data = data;
this.next = next;
}
function List(){
this.start = null;
this.end = null;
// add a node to the list
@mediaupstream
mediaupstream / jekyll-deploy.sh
Created November 19, 2015 10:34
Jekyll website deploy script, using scp
#!/bin/bash
user="username"
host="example.com"
port=22
site_folder="_site"
remote_folder="/var/www/example.com/"
scp -P $port -r ${site_folder}/* ${user}@${host}:${remote_folder}