Skip to content

Instantly share code, notes, and snippets.

@scmrus
scmrus / laravel54.php
Last active November 14, 2019 15:01
laravel54
<?php
// sql debug using tinker
DB::listen(function($sql){var_dump($sql->sql, $sql->bindings, $sql->time);});
// sql debug using log
DB::enableQueryLog();
dd(DB::getQueryLog());
// hashes
@rijnhard
rijnhard / docker
Last active June 28, 2020 07:55
[Consul + Registrator] #docker
#sysvinit /etc/default/docker
#append '--bip=172.17.42.1/24 --dns=172.17.42.1' to DOCKER_OPTS
DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --bip 172.17.42.1/24 --dns 172.17.42.1 --dns 8.8.8.8 --dns 8.8.4.4 --dns-search service.consul"
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active November 1, 2024 16:11
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@mrw34
mrw34 / gist:b12531d1a8df25f6c170
Last active May 21, 2024 10:47
Trello JSON to CSV conversion using jq
jq -r '["List", "Card"], ((reduce .lists[] as $list ({}; .[$list.id] = $list.name)) as $lists | .cards[] | select(.closed != true) | [$lists[.idList],.name]) | @csv' <nw3RUeLl.json
@mathiasverraes
mathiasverraes / phplint.sh
Created July 12, 2012 07:42
Recursive PHP Lint script
#!/bin/bash
for file in `find .`
do
EXTENSION="${file##*.}"
if [ "$EXTENSION" == "php" ] || [ "$EXTENSION" == "phtml" ]
then
RESULTS=`php -l $file`