Skip to content

Instantly share code, notes, and snippets.

@novemberborn
novemberborn / setup.md
Created January 7, 2016 15:05
OS X Redirect ports 80 and 443 to 8080 and 8443 respectively

Changes with .dev domains in mind.

Create /etc/pf.anchors/dev, containing:

rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443

@mauris
mauris / queue-ensure.php
Created April 28, 2014 15:44
Laravel Artisan Queue Ensurer - Set a cron job to run this file periodically to ensure that Laravel's queue is processing all the time. If the queue listener stopped, restart it!
<?php
function runCommand ()
{
$command = 'php artisan queue:listen > /dev/null & echo $!';
$number = exec($command);
file_put_contents(__DIR__ . '/queue.pid', $number);
}
if (file_exists(__DIR__ . '/queue.pid')) {
@spyl94
spyl94 / gist:3963465
Created October 27, 2012 08:00
Sublime Text 2 - Raccourcis utiles (Windows)

Sublime Text 2 – Raccourcis utiles (Windows)

Préambule

Voici une fiche mémo pour vous aider à retenir ces fameux raccourcis qui vont vous permettre de gagner en productivité. Prenez votre temps pour apprendre, il est généralement plus bénéfique de mémoriser un raccourci en lui associant une utilité tout en codant, plutôt que d’essayer de tout retenir d’un seul coup.
La notation Ctrl+KB signifie enfoncer les touches Ctrl et K simultanément puis relâcher K, enfoncer B tout en maintenant la touche Ctrl enfoncée.

Général

Ctrl+KB basculer la barre latérale
@mikejolley
mikejolley / gist:2044101
Last active May 18, 2021 17:02
WooCommerce - Show number of items in cart and total
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>