Somewhat like dotenv but for PHP.
The goals is to remove all config scattered about in files and have one authoritative source for that config info.
XVFB=/usr/bin/Xvfb | |
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset" | |
PIDFILE=/var/run/xvfb.pid | |
case "$1" in | |
start) | |
echo -n "Starting virtual X frame buffer: Xvfb" | |
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS | |
echo "." | |
;; | |
stop) |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
#!/bin/bash | |
# Note that this script requires you to have | |
# an X window running on Display :90 | |
# This can be done by running: /usr/bin/Xvfb :90 -ac -screen 0 1024x768x8 & | |
# | |
# You can save this script as /etc/init.d/selenium to start and stop selenium | |
PORT=4443 | |
DESC="Selenium server" |
require 'calabash-android/management/app_installation' | |
AfterConfiguration do |config| | |
FeatureNameMemory.feature_name = nil | |
end | |
$first_run = true | |
Before do |scenario| | |
@scenario_is_outline = (scenario.class == Cucumber::Ast::OutlineTable::ExampleRow) |
SELECT 'SELECT SETVAL(' ||quote_literal(S.relname)|| ', MAX(' ||quote_ident(C.attname)|| ') ) FROM ' ||quote_ident(T.relname)|| ';' | |
FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C | |
WHERE S.relkind = 'S' | |
AND S.oid = D.objid | |
AND D.refobjid = T.oid | |
AND D.refobjid = C.attrelid | |
AND D.refobjsubid = C.attnum | |
ORDER BY S.relname; |
Somewhat like dotenv but for PHP.
The goals is to remove all config scattered about in files and have one authoritative source for that config info.
** Find commmonly accessed tables and their use of indexes: | |
SELECT relname,seq_tup_read,idx_tup_fetch,cast(idx_tup_fetch AS numeric) / (idx_tup_fetch + seq_tup_read) AS idx_tup_pct FROM pg_stat_user_tables WHERE (idx_tup_fetch + seq_tup_read)>0 ORDER BY idx_tup_pct; | |
Returns output like: | |
relname | seq_tup_read | idx_tup_fetch | idx_tup_pct | |
----------------------+--------------+---------------+------------------------ | |
schema_migrations | 817 | 0 | 0.00000000000000000000 | |
user_device_photos | 349 | 0 | 0.00000000000000000000 |
git shortlog -e -s -n |
import requests | |
import subprocess | |
import json | |
import sys | |
import threading | |
import time | |
from Queue import Queue | |
numberOfViewers = int(sys.argv[1]) | |
builderThreads = int(sys.argv[2]) |
A curated list of amazingly awesome PHP libraries, resources and shiny things.