Skip to content

Instantly share code, notes, and snippets.

<?php
//set 3-second timeout
$opts = array('http'=>array(
"timeout" => 3
));
$context = stream_context_create($opts);
$latestRates = file_get_contents("http://somewhere.org/",false,$context);
@NoiseEee
NoiseEee / gist:5050272
Last active December 14, 2015 07:19
PHP talks to Node
<?php
/**
* An attempt to have PHP send shit to Node, so that it can emit to our connected JS clients
*
*/
class nodeNotifier {
public $dataToSend = array();
public $nodeServerPort = 8000;
public $broadcastNamespace;
<!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en"><!--<![endif]-->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js"></script>
<script src="filtersPerf.js"></script>
</head>
<body ng-app="filtersPerf">
<input ng-model="name"> {{name | logUppercase}}
</body>
<?php
/*
* a class that writes a basic webpage with a javascript alert, and options
*
* @param string $destinationURL the webpage to be redirected to
* @param string $windowMessage the message presented to the user in the javascript alert
* @param string $windowAction what to do: redirect to a new page, close (when called in a popup), or a combination.
*/
class popupMessage {
<?php
class Whatever() {
/**
* The database connection
* @var \PDO
*/
protected $db;
<?php
class Something() {
/**
* @var \User
*/
private $user;
}
[xdebug]
#PHP 7 extension dir below; use appropriate path
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp"
@NoiseEee
NoiseEee / casperTest.php
Last active March 24, 2016 01:58
What is the difference?
<?php
/**
* The Gearman Worker script
*/
$worker= new GearmanWorker();
$worker->addServer();
$worker->addFunction("LayoutbooksAssembler", "sendToCasper");
while ($worker->work());
import DS from 'ember-data';
import ENV from '../config/environment';
export default DS.JSONAPIAdapter.extend({
host: ENV.apiHost
});