Skip to content

Instantly share code, notes, and snippets.

View outrunthewolf's full-sized avatar
🍕
Pizza Tonight

outrunthewolf outrunthewolf

🍕
Pizza Tonight
View GitHub Profile
@outrunthewolf
outrunthewolf / gist:5652481
Created May 26, 2013 11:11
RGB to Hex javascript
var hex = rgb_to_colour(255, 255, 255);
rgb_to_colour: function(r,g,b)
{
return '#' + byte_to_hex(r) + byte_to_hex(g) + byte_to_hex(b);
},
byte_to_hex: function(n)
{
var nybHexString = "0123456789ABCDEF";
@outrunthewolf
outrunthewolf / gist:6815535
Created October 3, 2013 19:21
Multiline Dockerfile
...
RUN cat >/etc/apache2/sites-enabled/default <<EOF
<VirtualHost *:80>
DocumentRoot /home
UseCanonicalName Off
RewriteEngine on
RewriteMap lowercase int:tolower
@outrunthewolf
outrunthewolf / gist:6931446
Created October 11, 2013 08:28
untar and moving directory in Dockerfile - a bad way
RUN cd /home/$USERNAME
RUN mkdir downloads
RUN cd downloads
RUN wget http://www.something.com/test.tar.gz
RUN tar -zxvf test.tar.gz
RUN cd test
RUN ./configure
@outrunthewolf
outrunthewolf / Composer Dockerfile
Created December 18, 2013 08:21
Install Composer with Dockerfile
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/bin/composer
@outrunthewolf
outrunthewolf / gist:9503301
Created March 12, 2014 09:00
Dynamic routing Zend2
public function onBootstrap( MvcEvent $e ) {
// Get the service and event managers
$events = $e->getApplication()->getEventManager();
// Attach a dynamic render event
$events->attach(MvcEvent::EVENT_RENDER, function(MvcEvent $event) {
// Service Manager
$sm = $event->getParam('application')->getServiceManager();
$mod = $sm->get('ModuleManager');
location ^/index.php {
return 301 $scheme://$host$request_uri;
}

Keybase proof

I hereby claim:

  • I am outrunthewolf on github.
  • I am outrunthewolf (https://keybase.io/outrunthewolf) on keybase.
  • I have a public key whose fingerprint is CA96 2EB2 6516 C150 79FC 4D76 C02B AAEA F94E EA5A

To claim this, I am signing this object:

location = /framework/thirdparty/tinymce/tiny_mce_gzip.php {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
@outrunthewolf
outrunthewolf / gist:3658cef85b8c8d7cca89
Created December 17, 2014 12:35
Laravel DB Read/Write config
<?php
return array(
'connections' => array(
// Postgres
'pgsql' => array(
'driver' => 'pgsql',
'read' => array(
'host' => 'xxxxx-replica.amazonaws.com'
),
### Keybase proof
I hereby claim:
* I am outrunthewolf on github.
* I am outrunthewolf (https://keybase.io/outrunthewolf) on keybase.
* I have a public key whose fingerprint is F4E9 B160 419A F991 6550 822E D68B D2EB DE3D 508F
To claim this, I am signing this object: