Skip to content

Instantly share code, notes, and snippets.

View dprevite's full-sized avatar
🐈

Dan Previte dprevite

🐈
View GitHub Profile
@dprevite
dprevite / laravel_app.conf
Created May 5, 2014 18:01
Laravel listener supervisor
[program:laravel_app]
command=/usr/bin/php /var/www/production/api.thing.com/artisan queue:listen -vvv --queue=App --env=production
directory=/var/www/production/api.thing.com
stdout_logfile=/var/www/production/api.thing.com/app/storage/logs/app_supervisord.log
redirect_stderr=true
@dprevite
dprevite / parse_brackets.php
Created May 8, 2014 20:52
parse_brackets.php
<?php
function parse() {
$special = [
'[' => ']',
'{' => '}',
'(' => ')'
];
$string = str_split('(())');

Keybase proof

I hereby claim:

  • I am dprevite on github.
  • I am dprevite (https://keybase.io/dprevite) on keybase.
  • I have a public key whose fingerprint is A98D 75AB D814 79AD 11E9 BE13 B7B8 013A 8498 380A

To claim this, I am signing this object:

@dprevite
dprevite / tabfix.sh
Created November 23, 2014 07:43
tabfix tabs to spaces
# https://github.com/mar10/tabfix
sudo pip install -U tabfix
tabfix --input-tab-size=2 -r --match="*.html" -v target_dir/
@dprevite
dprevite / update_post_commits.php
Last active August 29, 2015 14:17
Search computer for all git repos and add lolcommits hook to all the post-commit files
<?php
/**
* Search forward starting from end minus needle length characters
*
* @param string $haystack The string to search within
* @param string $needle The string to search for
*
* @return boolean
**/
@dprevite
dprevite / post-commit
Created April 16, 2015 18:13
git post-commit for lolcommits
#!/bin/sh
export PATH="/usr/bin/ruby:$PATH"
lolcommits --capture --delay=3 --animate=8
slackup "#lolcommits" "$(ls ~/.lolcommits/${PWD##*/}/$(git rev-parse HEAD | cut -c1-11).*)" &
find . -type f -iname '*.php' -not -path "./vendor/*" -exec bash -c 'echo $0 && expand -t 2 -i "$0" >"$0.expand.tmp" && mv "$0.expand.tmp" "$0"' {} \;
@dprevite
dprevite / dump_tables.sh
Created December 16, 2011 15:39
Dump every table from every database into its own sql file
#!/bin/bash
# Simple MySQL dump script which dumps each database to a compressed
# file with the date included in the file name
MYSQL='/usr/bin/mysql'
MYSQLDUMP='/usr/bin/mysqldump'
DUMPOPTS='--opt --hex-blob --skip-extended-insert'
@dprevite
dprevite / dump_tables.php
Created February 12, 2012 07:41
Dump every table from every database into its own sql file (Fancy PHP version)
#!/usr/bin/php
<?php
// Install these with PEAR
require_once 'Console/CommandLine.php';
require_once 'Console/Color.php';
require_once 'Console/ProgressBar.php';
define('NL', "\n");
@dprevite
dprevite / farmlint.php
Created May 9, 2012 16:05
PHP Farm Linting for each installed version of PHP
#!/usr/bin/php
<?php
define('PHPFARM_BIN_PATH', '/home/dprevite/phpfarm/inst/bin/'); // WITH trailing slash
define('NL', "\n");
/**
* undocumented function
*