A curated list of amazingly awesome PHP libraries, resources and shiny things.
require 'rio' | |
require 'open-uri' | |
require 'uri' | |
unless ARGV[0] and ARGV[1] | |
puts "You must specify an operation and URL." | |
puts "USAGE: scrape.rb [page|images|links] <http://www.some_site.com>" | |
exit | |
end |
<?php | |
# Includes # | |
require_once('flight/Flight.php'); | |
# Database Information # | |
Flight::register('db', 'PDO', array('mysql:host=localhost;port=3306;dbname=btc', 'root', 'password'), function($db) { | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
}); |
#!/usr/bin/env php | |
<?php | |
$c = curl_init(); | |
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($c, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json')); | |
curl_setopt($c, CURLOPT_URL, 'http://data.mtgox.com/api/2/BTCUSD/money/ticker'); | |
$data = curl_exec($c); | |
curl_close($c); |
<?php | |
if(!file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])){ | |
$_GET['_url'] = $_SERVER['REQUEST_URI']; | |
} | |
return false; |
I hereby claim:
- I am xanza on github.
- I am zqueal (https://keybase.io/zqueal) on keybase.
- I have a public key whose fingerprint is 7B5A C030 0E2C 74FD 355C CC81 B1DA 56DC B73E 8516
To claim this, I am signing this object:
#!/usr/bin/perl -w | |
# Caclulate Volumes for ejuice | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 3 of the License. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
#!/usr/bin/env php | |
<?php | |
class DNS { | |
public function __construct() { | |
$q = $_SERVER['argv']; | |
if(isset($q[1])) { | |
$lookup = dns_get_record($q[1], DNS_ALL - DNS_PTR); | |
echo json_encode($lookup); | |
} else { |
#!/bin/bash
if [[ -t 0 && -z "$1" ]]; then
# output contents of clipboard
xclip -out -selection clipboard || exit 1
elif [[ -n "$1" ]]; then
# copy file contents to clipboard
xclip -in -selection clipboard < "$1" || exit 1
else
# copy stdin to clipboard
xclip -in -selection clipboard <&0 || exit 1
For this instructional tutorial we'll be exploring the installation and setup of both WordPress v4.0 and the required MySQL database used to support it. However, sometimes we find ourselves in interesting situations which either necessitate or involve remote instances of a MySQL server or database. Quite simply, most of the time remote databases or servers are used for security purposes--specifically security through obscurity and not having all of your eggs in a single basket.
Important: Please ensure that you are correctly modifying usernames, passwords, hostnames and IP addresses to suit your needs. If you do not, this setup will not work correctly for you.
LEMP (Linux, Nginx, MySQL, PHP) is one of the most stable and widely used production/development environments available to developers. Anything Apache can do, Nginx can do much faster. This includes PHP proc