Skip to content

Instantly share code, notes, and snippets.

@Chekote
Chekote / generics-style-notation-support.php
Last active December 7, 2018 20:34
Can't get PHPStorm's generic style notation support to work :(
<?php
/**
* @return ArrayObject<int, Result>
*/
function getResults() {
$results = new ArrayObject();
$results[] = new Result();
return $results;
@Chekote
Chekote / nginx.conf
Created July 18, 2018 14:04
Silence Nginx logs for favicon.ico and robos.txt
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
@Chekote
Chekote / parse-args.sh
Last active July 18, 2018 13:32
How to parse arguments passed to a shell script
parse_args() {
while [[ $# -gt 0 ]]; do
case $1 in
-b|--branch) branch="$2" ;;
-t|--tag) tag="$2" ;;
--timeout) timeout="$2" ;;
*) break ;;
esac
shift 2
done
@Chekote
Chekote / github-wide-diffs.css
Created July 5, 2018 18:24
GitHub: Wide diffs
div.diff-view {
width: 1050px;
}
@Chekote
Chekote / zenhub-hide-pipeline-col.css
Last active July 5, 2018 18:23
ZenHub: Hide Pipeline Col
.zhc-pipeline--add-placeholder {
display: none;
}
@Chekote
Chekote / zenhub-hide-collapsed-cols.css
Last active July 5, 2018 18:23
ZenHub: Hide Collapsed Columns
.zhc-pipeline--is-collapsed {
display: none;
}
@Chekote
Chekote / compile-php-extension.sh
Last active October 7, 2022 15:41
How to compile a PHP extension into a shared module for any PHP version
# How to compile a PHP extension into a shared module for any PHP version
# download and decompress required PHP version source (e.g. 5.6.30). See http://php.net/releases/
wget http://php.net/get/php-5.6.30.tar.bz2/from/this/mirror -O php-5.6.30.tar.bz2
tar xvf php-5.6.30.tar.bz2
# compile and install PHP to temporary location (e.g. ~/php-install)
cd php-5.6.30/
time ./configure --prefix=${HOME}/php-install
make -j 8
@Chekote
Chekote / selenium_curl.sh
Created August 10, 2017 00:21 — forked from prashanthrajagopal/selenium_curl.sh
Run Selenium test via curl
s_id=`curl -X POST http://127.0.0.1:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName":"firefox","platform":"MAC"}}'|awk -F'"' '{print $6}'`
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/url -d '{"url":"http://www.google.com"}'
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element -d '{"using":"id","value":"gbqfq"}'
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element/0/value -d {"value":["selenium"]}
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element -d '{"using":"id","value":"gbqfb"}'
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element/1/click
curl -X DELETE http://127.0.0.1:4444/wd/hub/session/$s_id/window
@Chekote
Chekote / nginx.conf
Last active July 5, 2018 18:56
nginx config for remote php-fpm
server {
listen 80;
server_name WEBSERVER_HOSTNAME_GOES_HERE;
root /var/www/public;
index index.html index.php;
access_log syslog:server=unix:/dev/log;
error_log syslog:server=unix:/dev/log;
location / {