This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
top -b -i -n 20 >> topInfo.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stripe.setPublishableKey('pk_test_Wfzrj4uDDPOcv7XxVJKXRERS'); | |
var stripeResponseHandler = function(status, response) { | |
if (response.error) { | |
// show the errors on the form | |
$("#stripe-errors").html(response.error.message); | |
} else { | |
var token = response['id']; | |
var form$ = $("#addservice-form"); | |
form$.append("<input type='hidden' name='stripeToken' value='" + token + "' />"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("/srv/www/vpsstat.us/public_html/includes/stripe-php/lib/Stripe.php"); | |
Stripe::setApiKey("sk_test_xxxxxxxxxxxxxxxxxxxxxxxx"); | |
$token = ($_GET['stripeToken']) ?$_GET['stripeToken'] : $_POST['stripeToken']; | |
$customerDetails = get_customer_details($customer_id); | |
if (empty($customerDetails['stripe_id'])) { | |
$customer = Stripe_Customer::create(array( | |
"card" => $token, | |
"plan" => "standard", | |
"email" => $customerDetails['email'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !https://launchpad.net/wicd$ | |
RewriteRule $ https://launchpad.net/wicd [R=301,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Content-Type: text/html"); | |
require 'AltoRouter.php'; | |
$router = new AltoRouter(); | |
$router->setBasePath(''); | |
/* Setup the URL routing. This is production ready. */ | |
$router->map('GET','/', 'home.php', 'home'); | |
$router->map('GET','/home/', 'home.php', 'home-specific'); | |
$router->map('GET','/home', 'home.php', 'home-specific-noslash'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: application/json'); | |
$dob = "8/17/1983"; | |
$json = '{ | |
"person": { | |
"age": { | |
"years": 23, | |
"months": 8, | |
"weeks": 2, | |
"days": 5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('PAPERTRAIL_PORT','123456'); | |
function send_remote_syslog($message, $component = "web", $program = "next_big_thing") { | |
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
foreach(explode("\n", $message) as $line) { | |
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line; | |
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, 'logs.papertrailapp.com', PAPERTRAIL_PORT); | |
} | |
socket_close($sock); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule . /index.php [L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Content-Type: text/html"); | |
include dirname(__FILE__) . '/includes/AltoRouter.php'; | |
$router = new AltoRouter(); | |
$router->setBasePath(''); | |
/* Setup the URL routing. This is production ready. */ | |
// Main routes that non-customers see | |
$router->map('GET','/', 'home.php', 'home'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$customer = new Customer(); | |
$customer_id = $match['params']['customer_id']; | |
if ($customer->valid_customer($customer_id) && $customer->needs_paid($customer_id)) { | |
$customer->pay($customer_id); | |
} | |
?> |