Skip to content

Instantly share code, notes, and snippets.

View tomardern's full-sized avatar

Tom Ardern tomardern

  • Midnite.com
  • London
View GitHub Profile
@tomardern
tomardern / Instructions.txt
Created March 28, 2014 12:44
Apache Wildcard Virtual Hosts
1. Enable 'LoadModule vhost_alias_module modules/mod_vhost_alias.so' within http.conf
2. Add the following to /extras/httpd-vhosts.conf
<VirtualHost *:80>
UseCanonicalName Off
VirtualDocumentRoot "C:/__HTDOCS/%0"
LogFormat "%h $v %V %f %t \"%r\" %>s %b" common
CustomLog logs/404_logging.log combined
</VirtualHost>
@tomardern
tomardern / gist:2c035e9c0107ba2950ba
Created July 7, 2014 16:21
Change WordPress URL
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@tomardern
tomardern / gist:4e75b33ba6a678abfb7a
Last active August 29, 2015 14:08
Fully Selectable, HTML Valid, Replicable, Nice-Looking
<!DOCTYPE html><html id="b"><head></head><body><textarea id="t"></textarea><script>t.value='<!DOCTYPE html>'+b.outerHTML;</script></body></html>
@tomardern
tomardern / gist:bf7664f7d787898ca3f2
Created March 27, 2015 10:58
Old Script for Quick Weka Comparisons
<?php
error_reporting(0);
function search($lines,$text,$after){
$textLines = explode("\n", $lines);
@tomardern
tomardern / gist:e41c1944a6b5d48ac3bc
Created March 27, 2015 11:01
Weka PowerShell Script
cls
$path = "C:\Weka-3-6\data\"
$output = "C:\Weka-3-6\dwm_output\"
$files = get-childitem $path
Add-Content $output"console_log.txt" "STARTING NEW OUTPUT =-------------------------------- ";
#Loop though all the files of directory
foreach ($file in $files) {
@tomardern
tomardern / gist:00e0cc914af3b66abe44
Created May 18, 2015 15:13
Local SSH as a proxy
ssh -D 1337 -C -q -N user@remote -p 22
@tomardern
tomardern / gist:8ead8229afd856a60a8596f71d137197
Created November 12, 2016 21:04
Upgrading PHP5.4 to PHP5.6 on CentOS7
Resource:
https://support.rackspace.com/how-to/install-epel-and-additional-repositories-on-centos-and-red-hat/
#Step 1 - Add the IUS Repo
wget https://centos7.iuscommunity.org/ius-release.rpm
#Add it to YUM, U=upgrade, v=verbose, h=hash
sudo rpm -Uvh ius-release*.rpm
#Step 2 - Add the yum plugin replace package
@tomardern
tomardern / component.js
Created October 19, 2017 13:02
Angular ES6 Component Style
const DEMO_COMPONENT_NAME = "demoComponent";
// before angular 1.5 component : directive was the way to create component
const demoComponent = {
template: '<h1>Hello world</h1><h2>{{$ctrl.domAttribute}}</h2>',
bindings: {
domAttribute: '@',
onSomething: '&', // function call out
demoAttr2: "<" // Data in
@tomardern
tomardern / index.js
Created October 22, 2017 16:39
Express Function Logging in Firebase functions
const functions = require('firebase-functions');
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
/**
* Route all firebase function requests through to express
* See https://codeburst.io/express-js-on-cloud-functions-for-firebase-86ed26f9144c
*/
const app = express();
<!DOCTYPE html>
<html>
<head>
<title>My first three.js app</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>
<body>