Skip to content

Instantly share code, notes, and snippets.

@FoxxMD
FoxxMD / postalcodes
Created May 20, 2014 18:41
postal code sample data
Group 1 Group 2 Group 3
1000AB 1011AA 1999AE
1000AC 1023AV 1000BC
1002BF 1044AN 1223KB
-ea
-server
-Xms1g
-Xmx1g
-Xss16m
-XX:PermSize=256m
-XX:MaxPermSize=256m
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+UnlockExperimentalVMOptions
@FoxxMD
FoxxMD / node-api-oauth-proxy.js
Last active February 13, 2018 21:44
A snippet of an express app that authenticates users using oauth and serves apis through a proxy
var express = require("express");
var bodyParser = require("body-parser");
var httpProxy = require('http-proxy');
var url = require('url');
var sessions = require("client-sessions");
// configure session cookie
// sessions encrypts the cookie so even though the client has physical access
// the information it holds is not revealed (client's access token)
@FoxxMD
FoxxMD / install-redis.sh
Created October 12, 2015 16:55 — forked from four43/install-redis.sh
Install Redis
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.githubusercontent.com/four43/e00d01ca084c5972f229/raw/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@FoxxMD
FoxxMD / liteJsonTransform.php
Last active October 20, 2015 13:33
Json serialization without dependencies
<?php
abstract class Base {
public function getPublicVars() {
return call_user_func('get_object_vars', $this);
}
}
@FoxxMD
FoxxMD / redux-animation.js
Created December 10, 2015 13:49
something to use for animations with react/redux
//requires https://github.com/gaearon/redux-thunk
//https://www.reddit.com/r/reactjs/comments/3vw7xq/reduxflux_animation_confusion/cxrpjbx
export default {
offset: 0,
interval: 0,
started: false,
paused: false,
start(offset, onTick) {
this.reset();
@FoxxMD
FoxxMD / ascii.txt
Created August 25, 2016 13:45
ASCII I might use in comments
, ,
/ \/ \
(/ //_ \_
.-._ \|| . \
\ '-._ _,:__.-"/---\_ \
______/___ '. .--------------------'~-'--.)__( , )\ \
`'--.___ _\ / | Here ,' \)|\ `\|
/_.-' _\ \ _:,_ Be Dragons " || (
.'__ _.' \'-/,`-~` |/
'. ___.> /=,| Abandon hope all ye who enter |
@FoxxMD
FoxxMD / resources.text
Created December 18, 2018 21:24
programming practice
https://github.com/karan/Projects
https://github.com/tastejs/awesome-app-ideas
https://github.com/prakhar1989/awesome-courses
https://github.com/danistefanovic/build-your-own-x
https://github.com/joereynolds/what-to-code
@FoxxMD
FoxxMD / Plex nvdec enable.sh
Created April 3, 2019 15:57 — forked from Xaero252/Moved.md
Enable nvdec support for plex dockers on unraid
#!/bin/bash
# This should always return the name of the docker container running plex - assuming a single plex docker on the system.
con="$(docker ps --format "{{.Names}}" | grep -i plex)"
echo -n "<b>Applying hardware decode patch... </b>"
# Check to see if Plex Transcoder2 Exists first.
exists=$(docker exec -i "$con" stat "/usr/lib/plexmediaserver/Plex Transcoder2" >/dev/null 2>&1; echo $?)
@FoxxMD
FoxxMD / massDeleteDiscord.js
Last active January 5, 2021 15:01
mass delete discord messages for a channel
// based on https://stackoverflow.com/a/49462738/1469797
// What It Do?
//
// Will delete all messages in a channel AFTER the message id specified
//
// Specify username/descriminator to only delete by user,
// or leave empty to delete all messages
// How To Use