Skip to content

Instantly share code, notes, and snippets.

View paperdarwin's full-sized avatar

Paper Darwin paperdarwin

  • Paperstreet Media
  • Over There
View GitHub Profile
@dullgiulio
dullgiulio / mailq-parser.php
Created March 24, 2011 21:13
Trivial mailq output parser in PHP.
<?php
/**
* Simple example PHP code to parse "mailq" output. Useful if you want to show
* the mail queue status through some web service.
*
* Notice that you'll need a mail server (sendmail or, better, postfix) to be
* running on the same machine as your webserver (often that's less that
* optimal.)
*
* If this doesn't work, be sure to check that you have sufficient permissions
@jeremyharris
jeremyharris / FixtureTestCase.php
Last active December 19, 2021 19:04
Full code for: http://someguyjeremy.com/blog/database-testing-with-phpunit Place fixtures in a `fixture` folder.
<?php
// we're loading the Database TestCase here
require 'PHPUnit' . DIRECTORY_SEPARATOR . 'Extensions' .
DIRECTORY_SEPARATOR . 'Database' . DIRECTORY_SEPARATOR .
'TestCase.php';
class FixtureTestCase extends PHPUnit_Extensions_Database_TestCase {
public $fixtures = array(
'posts',
@julionc
julionc / 00.howto_install_phantomjs.md
Last active July 8, 2024 21:44
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@simkimsia
simkimsia / ng-book.conf
Last active July 9, 2016 02:52
restler api nginx config
server {
listen 80;
client_max_body_size 2M;
server_name ng-book.oppoin.com;
root /var/virtual/ng-book.oppoin.com/current/examples/http-api-server;
location / {
index index.html index.htm;
}
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@chiraggude
chiraggude / Install Ruby and RubyGems
Last active December 14, 2018 07:14
Install Ruby 2.1.1 and RubyGems 1.8.25 on CentOS 6.5
# Install Ruby
wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz
tar xvzf ruby-2.1.1.tar.gz
cd ruby-2.1.1
./configure --prefix=/usr
make
make install
# remove "ruby-2.1.1" folder in /root
@paperdarwin
paperdarwin / sort_bymb.sh
Created August 11, 2015 20:35
sort folders by size
du --block-size=MiB --max-depth=1 path | sort -n