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
# Find your Start of collections | |
collections: | |
content-sections: | |
output: true | |
title: Content Sections | |
# Continue with other collections |
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
function rand( min, max ) { | |
var seed = Math.random(); | |
if( typeof min != 'number' && typeof max != 'number' ) { | |
return seed; // default is just random | |
} else if( typeof min == 'number' && typeof max != 'number' ) { | |
return Math.round( seed * min ); | |
} return Math.floor( seed * max ) + min; | |
} | |
// |
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
# Email SQLite Backup Hack | |
# 2015 | |
# Lewis Cowles | |
# Nasty Python 2.7 Compatible E-Mail Backup (Once done) | |
import imaplib, email, sqlite3 | |
from email.utils import * | |
from datetime import datetime | |
# Setup DB |
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
from flask import Flask | |
from flask import g, abort, redirect, Response, request | |
import json | |
import sqlite3 | |
import datetime | |
app = Flask(__name__) | |
@app.before_request |
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
# FormData / Flat-to-Structured Dictionary Accessories For Python | |
# Copyright (C) 2015 Lewis Cowles | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
#!/bin/sh | |
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - | |
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" > /etc/apt/sources.list.d/virtualbox.list' | |
sudo apt-get update -y | |
sudo apt-get install -y dkms unzip virtualbox-5.0 vagrant | |
wget https://dl.bintray.com/mitchellh/otto/otto_0.1.1_linux_amd64.zip -O otto.zip | |
unzip otto.zip | |
rm otto.zip | |
mv otto /usr/local/bin/otto |
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 : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "debian/jessie64" | |
config.vm.network "private_network", ip: "10.0.0.7" | |
config.vm.hostname = "magento2.local" | |
config.vm.provider "virtualbox" do |vb| | |
# Display the VirtualBox GUI when booting the machine |
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
#!/bin/bash | |
# Root Check | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
apt-get install -qq expect |
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
"use strict"; | |
String.prototype.pad = function( len, c, left ) { | |
var s = '', | |
c = ( c || ' ' ), | |
len = Math.max( len, 0 ) - this.length, | |
left = ( left || false ); | |
while( s.length < len ) { s += c }; | |
return ( left ? ( s + this ) : ( this + s ) ); | |
} | |
Number.prototype.pad = function( len, c, left ) { |
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
#!/bin/bash | |
# Root Check | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
# Get rid of Wolfram | |
sudo apt-get purge wolfram-engine |