This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// safely handles circular references | |
JSON.safeStringify = (obj, indent = 2) => { | |
let cache = [] | |
const retVal = JSON.stringify( | |
obj, | |
(key, value) => | |
typeof value === 'object' && value !== null | |
? cache.includes(value) | |
? undefined // Duplicate reference found, discard key | |
: cache.push(value) && value // Store value in our collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initial Setup and install apache | |
apt-get update | |
apt-get -y install git curl vim | |
apt-get install -y apache2 libapache2-mod-fastcgi | |
a2enmod actions fastcgi rewrite | |
sudo service apache2 restart | |
# Edit /etc/apache2/sites-available/000-default.conf to add these lines: | |
<Directory "/var/www/html"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Update your Vagrant install before using. | |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/xenial64" | |
config.vm.network "private_network", ip: "192.168.71.71" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Prevent Different Types of scrolling */ | |
// left: 37, up: 38, right: 39, down: 40, | |
// spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 | |
var keys = { 37: 1, 38: 1, 39: 1, 40: 1 }; | |
function preventDefault(e) { | |
e = e || window.event; | |
console.log(e.target); | |
if (e.preventDefault) e.preventDefault(); | |
e.returnValue = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// include WP core functions | |
define( 'WP_USE_THEMES', false ); | |
require_once( 'wp-load.php' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!window.location.origin) { | |
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
from sys import argv | |
from os.path import exists | |
from os import makedirs | |
from os import symlink | |
from os import system | |
import getopt | |
# |