Skip to content

Instantly share code, notes, and snippets.

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
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

@alcaeus
alcaeus / README.md
Last active April 19, 2021 14:26
Enable GPG for git commits

Enable GPG for git commits

Generate a key

  1. Install gpg and gpg-agent: brew install gpg gpg-agent
  2. Generate a new key: run gpg --gen-key and follow the instructions
  3. Write down the ID of the key. To do this, run gpg --list-keys. The output will look like this:
pub   4096R/E9468C9A 2016-04-20 [expires: 2016-07-19]
uid Andreas B. 
@guilhermeblanco
guilhermeblanco / debug-fpm-segfaut.md
Created June 8, 2016 15:59
Debugging PHP-FPM segfaults

Assuming PHP is compiled with debug enabled.

$ gdb /usr/sbin/php-fpm

Then:

r --nodaemonize --fpm-config /etc/php7/fpm/php-fpm.conf
@KINGSABRI
KINGSABRI / Powerline-shell-install-ubuntu.md
Last active September 26, 2021 23:16
Install Powerline-Shell on Ubuntu

Environment

  • Kubuntu 16.04.2 TLS
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial
  • Shell environment: Bash
  • Terminal application : Konsole
@anjesh
anjesh / php-source-exploration-process.md
Created August 14, 2017 14:21
Notes taken during php source exploration to identify weird error message

Native mocks versus PHPUnit mocks

Mock type Tests duration
Native mocks 160.10 seconds
Mockery 177.01 seconds (+10%)
PHPUnit mocks 232.29 seconds (+45%)
Prophecy 3868.80 seconds (+2416%)
@matheusfaustino
matheusfaustino / phpbrew_change_by_dir.sh
Last active April 29, 2020 19:06
Zsh function to change php version per project (directory) using phpbrew
# Add at the end of your .zshrc file
# After every command `cd`, it will check a ".phpbrew" file in the current directory and if it exists it will change the version of php automatically
# Create a .phpbrew file like this: `echo "7.4.4" > .phpbrew` in the folder you want to use the specific version of php
function phpbrew_change_by_dir() {
emulate -L zsh
if [ -f ".phpbrew" ]; then
PHPBREW_LOCAL_VERSION=$(cat .phpbrew);
COMMAND="phpbrew use ";
rackspace/php-opencloud/lib/OpenCloud/Common/Metadata.php:40
In method __set():
return $this->setProperty($property, $value);
kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:989
In method __set():
return $this->_[HDOM_INFO_OUTER] = $value;
kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:992
In method __set():
return $this->_[HDOM_INFO_TEXT] = $value;
kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:994
@sgolemon
sgolemon / git-gist
Created June 17, 2020 13:39
Command-line gist writer
#!/usr/local/bin/php
<?php
// Get a key from Github > Settings > Developer Settings > Personal Access Tokens
// Create a token with only the 'gist' permission.
const GISTKEY = '';
const GISTUSER = ''; // Put your github username here. Duh.
const GISTPOST = 'https://api.github.com/gists';
$headers = [