Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Alex Scotton Illizian

🏠
Working from home
View GitHub Profile
View NodeJS basic log function
// =============================================================== [ 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);
},
View Gruntfile.js
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'
},
View justgiving.html
<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 Aug 29, 2015
connectivity.sh
View crontab
# m h dom mon dow command
*/1 * * * * /home/alex/connectivity.sh
@Illizian
Illizian / README.md
Last active Aug 29, 2015
An Android MonkeyRunner script for keeping Clash of Clan sessions awake
View README.md
View keybase.md

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 / zsh-apache-virtual-hosts.zsh
Last active Dec 22, 2015
A zsh / bash script for setting up Apache virtual hosts automatically on ubuntu. Add to your .zshrc or .profile and run www domain.com
View zsh-apache-virtual-hosts.zsh
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}"
View gist:8521743
<?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'));
@Illizian
Illizian / glyphicons.jsx
Created Jan 13, 2016
React Glyphicon Constants
View glyphicons.jsx
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 Jan 21, 2016
A script for generating the requisite directory structure for VSCode's "Local History" plugin
View README.md

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