Skip to content

Instantly share code, notes, and snippets.

@worthwhileindustries
worthwhileindustries / example.php
Created March 14, 2017 21:20 — forked from ralphschindler/example.php
Zend\Db\Sql\Select example usage
<?php
use Zend\Db\Sql\Select;
// basic table
$select0 = new Select;
$select0->from('foo');
// 'SELECT "foo".* FROM "foo"';
@worthwhileindustries
worthwhileindustries / branch-color.sh
Created October 3, 2017 21:39 — forked from michaelminter/branch-color.sh
Bash profile with color current git branch color coded by status
# Git status bash prompt
#
# In addition to printing the current working directory, this prompt will
# show a number of things if you are in a git repository:
# - The current branch you are in
# - Whether there are untracked files in the repository (there will be an
# asterisk after the branch nome if there are)
# - Whether there are any unmerged/unstaged/staged changes or if the directory
# is clean. See below for the colors that will be used, and change them if
# you'd like.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@worthwhileindustries
worthwhileindustries / Results.md
Created February 14, 2018 16:59 — forked from nkt/Results.md
ReactPHP vs Node.js

wrk -t4 -c400 -d10s http://127.0.0.1:1337/

PHP

Running 10s test @ http://127.0.0.1:1337/
  4 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
 Latency 7.02ms 6.94ms 82.86ms 85.27%
@worthwhileindustries
worthwhileindustries / .env.gitlab
Created April 18, 2018 17:29
Laravel Dusk (PHPUNIT) Test for Gitlab-ci with docker chromdriver , headless chrome, vnc, screenshots, pipeline, artifacts
APP_ENV=testing
APP_KEY=base64:DimZ0aVNA8ZWtWxTB4fDxFc6lL1wM2C7evETA4QK3+c=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost:8081
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=secca_testing
@worthwhileindustries
worthwhileindustries / docker-cleanup-resources.md
Created September 18, 2018 18:02 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@worthwhileindustries
worthwhileindustries / logout_all_users.php
Created October 11, 2018 21:16 — forked from junaidpv/logout_all_users.php
Drupal 7 CLI script to logout all users and clear sessions
<?php
// Bootstrap
// Change chdir to the full path of your Drupal root
define('DRUPAL_ROOT', getcwd());
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'];
$_SERVER['REMOTE_ADDR'] = "127.0.0.1";
$_SERVER['REQUEST_METHOD'] = NULL;
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
xcode with development tools
homebrew
rvm
vagrant
virtualbox
iterm2
alfred
http://spectacleapp.com/ (allows you to snap windows around with kb shortcuts)
BetterSnapTool if spectacle doesn't do what you want
remap your caps lock key to command
@worthwhileindustries
worthwhileindustries / OrSearchFilter.php
Created February 21, 2019 21:15 — forked from axelvnk/OrSearchFilter.php
Api platform OR search filter
<?php
namespace Axelvkn\AppBundle\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Core\Exception\InvalidArgumentException;
use Doctrine\ORM\QueryBuilder;
class OrSearchFilter extends SearchFilter
@worthwhileindustries
worthwhileindustries / react-var_dump.js
Created December 10, 2020 23:25 — forked from 8ctopotamus/react-var_dump.js
Display data in React, kinda like PHP's var_dump();
const dataDump = props => <pre>{JSON.stringify(props, null, 2)}</pre>