Skip to content

Instantly share code, notes, and snippets.

View Firesphere's full-sized avatar
🐮
I may be slow to respond.

Simon Erkelens Firesphere

🐮
I may be slow to respond.
View GitHub Profile
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*/
/**
* collect all files which have been added, copied or
* modified and store them in an array called output
*/
<?php
class MysiteRequirementsBackend extends Requirements_Backend {
/**
* Register the given JavaScript file as required.
*
* @param string $file Relative to docroot
*/
public function javascript($file) {
@Firesphere
Firesphere / Vagrantfile
Created March 13, 2016 02:51
TwistedBytes Vagrant machine
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "twistedbytes/webserver"
if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
config.cache.scope = :box
@Firesphere
Firesphere / FlushCaches.php
Last active November 3, 2015 20:02
This little gist is for Twisted Bytes hosted caches, to clear the Varnish and SilverStripe Cache.
<?php
/**
* @author Simon 'Sphere' Erkelens
* This little task clears out the caches for the current website on Twisted Bytes servers with Varnish.
*/
class FlushCaches extends BuildTask
{
public function __construct()
@Firesphere
Firesphere / gist:7502231
Last active December 28, 2015 12:39
Dit is hoe ik generic inputs ineens toch laat reageren op Bootstrap-input-styling. Ik wijs de Bootstrap-styling toe aan inputs omdat Silverstripe dat zelf niet goed kan. Problem solved!
input, textarea, select, input.action {
.form-control;
}
.field, input.action, .Actions {
.col-xs-6;
}
<VirtualHost *:80>
ServerName vcap.me
ServerAlias *.vcap.me
VirtualDocumentRoot "/home/~user/htdocs/%1"
ErrorLog "logs/errors.log"
<directory "/home/~user/htdocs/%1">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
@Firesphere
Firesphere / gist:5941861
Created July 7, 2013 01:06
simple vhost alias
<VirtualHost *:80>
ServerName vcap.me
ServerAlias *.vcap.me
VirtualDocumentRoot "d:\wamp\www\%1"
ErrorLog "logs\errors.log"
<directory "d:\wamp\www\%1">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
@Firesphere
Firesphere / gist:1545226
Created December 31, 2011 20:20
And this is my apache-user's history... It does not make sense at all.
cat /var/www/.bash_history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r -n
185 up
68 up;sake
52 ListenerDaemon.log
48
27 -start
26 -stop
13 ListenerDaemon.err
11 dev/build
10 ../log/error.log
@Firesphere
Firesphere / gist:1545220
Created December 31, 2011 20:17
You might think I hardly use sqlite. You thought correct.
cat .sqlite_history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r -n
98 INTO
2
@Firesphere
Firesphere / gist:1545176
Created December 31, 2011 20:01
VPS most used commands... appearantly, 1 is empty
history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r -n
164 cd
162 ls
132 cat
88 tail
80 top
68 aptitude
49 /etc/init.d/apache2
35 vim
22 exit