Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Illizian's full-sized avatar
🏠
Working from home

Alex Scotton Illizian

🏠
Working from home
View GitHub Profile
@Illizian
Illizian / zsh-apache-virtual-hosts.zsh
Last active December 22, 2015 06:09
A zsh / bash script for setting up Apache virtual hosts automatically on ubuntu. Add to your .zshrc or .profile and run www domain.com
www() {
bold=`tput bold`
normal=`tput sgr0`
if [ ! $1 ] ; then
print "Usage: \n$ www url"
return 1
elif [ $1 ] ; then
username=$(id -un)@$(hostname)
echo "${bold}Creating www directories in /var/www/$1/${normal}"
<?php
// Create a plain request - Working
$request = Request::create('{API_ENDPOINT}', 'GET');
$response = Route::dispatch($request)->getContent();
// Create a request with secret in header
$request = Request::create('{API_ENDPOINT}', 'GET');
$headers = new Symfony\Component\HttpFoundation\HeaderBag(array('secret' => 'A_LONG_SECRET_KEY'));
// =============================================================== [ Logging ] ====
var colors = require('colors');
var moment = require('moment');
log = {
level: 3,
console : function(level, prefix, title, message) {
var timestamp = moment().format('HH:MM:ss');
if(level <= log.level && process.env.NODE_ENV !== "test" && title !== '') return console.log(prefix + ' ' + timestamp.grey + ' : ' + title.bold + ' ' + message);
if(level <= log.level && process.env.NODE_ENV !== "test") return console.log(prefix + ' ' + timestamp.grey + ' : ' + message);
},
@Illizian
Illizian / Gruntfile.js
Created August 30, 2014 15:23
alexscotton.com
var rewriteRulesSnippet = require("grunt-connect-rewrite/lib/utils").rewriteRequest;
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
@Illizian
Illizian / justgiving.html
Created September 25, 2014 15:42
JustGiving
<div id="jg-widget-ksbcycles100miles-327"></div>
<script>
(function() {
var id = "jg-widget-ksbcycles100miles-327",
doc = document,
pfx = (window.location.toString().indexOf("https") == 0) ? "https" : "http";
var el = doc.getElementById(id);
if (el) {
var js = doc.createElement('script');
js.src = pfx + "://widgets.justgiving.com/fundraisingpage/ksbcycles100miles?enc=ZT1qZy13aWRnZXQta3NiY3ljbGVzMTAwbWlsZXMtMzI3Jnc9NDAwJmI9aW1hZ2UsZG9uYXRlLGZ1bmRyYWlzZSZpYj10aXRsZSxzdW1tYXJ5LHByb2dyZXNzLHJhaXNlZCx0YXJnZXQ%3D";
@Illizian
Illizian / crontab
Last active August 29, 2015 14:09
connectivity.sh
# m h dom mon dow command
*/1 * * * * /home/alex/connectivity.sh
@Illizian
Illizian / README.md
Last active August 29, 2015 14:11
An Android MonkeyRunner script for keeping Clash of Clan sessions awake

Keybase proof

I hereby claim:

  • I am illizian on github.
  • I am illizian (https://keybase.io/illizian) on keybase.
  • I have a public key whose fingerprint is 98D5 0546 AA08 EA46 3591 8792 8234 D83E 3A8A DBB1

To claim this, I am signing this object:

@Illizian
Illizian / glyphicons.jsx
Created January 13, 2016 17:09
React Glyphicon Constants
var GlyphiconConstants = {
Glass: <span className='glyphicon glyphicon-glass' />,
Music: <span className='glyphicon glyphicon-music' />,
Search: <span className='glyphicon glyphicon-search' />,
Envelope: <span className='glyphicon glyphicon-envelope' />,
Heart: <span className='glyphicon glyphicon-heart' />,
Star: <span className='glyphicon glyphicon-star' />,
StarEmpty: <span className='glyphicon glyphicon-star-empty' />,
User: <span className='glyphicon glyphicon-user' />,
Film: <span className='glyphicon glyphicon-film' />,
@Illizian
Illizian / README.md
Last active January 21, 2016 16:12
A script for generating the requisite directory structure for VSCode's "Local History" plugin

Having installed VSCode's Local History plugin I found that I was getting ENOENT errors. This command will generate the required directory structure within your projects .history folder.

Please Note: This will remove any existing .history folder from your project.

Installation

  1. Open your .bash_profile or .zshrc file
  2. Add script.sh to the bottom of the file
  3. Either restart your terminal, or run source .bash_profile or source .zshrc

Usage