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 | |
function query($action, $params = array()) { | |
$context = stream_context_create(array( | |
'http' => array( | |
'method' => 'GET', | |
'header' => "Content-type: application/json\r\n", | |
'ignore_errors' => true, | |
) | |
)); |
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 | |
// in /app/bootstrap.phpunit.php: | |
require_once __DIR__.'/bootstrap.php.cache'; | |
require_once __DIR__.'/AppKernel.php'; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Symfony\Component\Console\Output\ConsoleOutput; |
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
$doc = new DomDocument; | |
$doc->preserveWhitespace = true; | |
$doc->formatOutput = false; | |
$doc->loadHtml( | |
'<ul id="ProjectSubmenu"> | |
<li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li> | |
<li> | |
<a href="/projects/markdown/basics" title="Markdown Basics">Basics</a> | |
</li> |
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 | |
class NgramTokenizer | |
{ | |
public static function tokenize($word, $n) | |
{ | |
if ($n === 1) { | |
return str_split($word); | |
} |
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
CREATE OR REPLACE FUNCTION public.get_locations() | |
RETURNS SETOF public.locations AS | |
$BODY$ | |
DECLARE | |
l_record public.locations; | |
BEGIN | |
FOR l_record IN | |
SELECT * FROM public.locations | |
ORDER BY location_desc |
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
get-wmiobject Win32_ComputerSystem | format-list * | |
get-wmiobject Win32_Processor | format-list * | |
get-wmiobject Win32_PhysicalMemory | format-list * |
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
1 Piston | |
1 Iron Ingot | |
1 Iron Dust | |
1 Redstone | |
3 Wood | |
4 Stone | |
1 Coil | |
1 Silver Ingot | |
1 Silver Dust |
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 | |
$options = array(); | |
for ($d = new \DateTime('1970-01-01 09:00:00'); $d < new \DateTime('1970-01-01 19:00:00'); $d->modify('+ 15 minutes')) { | |
$time = $d->format('H:i'); | |
$options[$time] = $time; | |
} |
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
function color_test { | |
# Daniel Crisman's ANSI color chart script from | |
# The Bash Prompt HOWTO: 6.1. Colours | |
# http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html | |
# | |
# This function echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background |
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 | |
use Guzzle\Common\Event; | |
use Guzzle\Http\Message\Header; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
class ForceCharsetPlugin implements EventSubscriberInterface | |
{ | |
private $forcedCharset = 'utf8'; |
OlderNewer