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 | |
// 160x120 image pixel dimensions | |
// PPM Header | |
echo "P3\n"; | |
echo "160 120\n"; | |
echo "255\n"; | |
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); |
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 | |
// convert utf8 character to its unicode code point | |
function utf8decode($chr){ | |
switch(strlen($chr)){ | |
case 1: | |
$x = unpack('c',$chr); | |
$dec = $x[1] & 127; | |
break; | |
case 2: | |
$x = unpack('c*',$chr); |
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 | |
// utf8-encode a unicode code point | |
function utf8encode($cp){ | |
if($cp <= 0x7f){ | |
return pack("c", $cp); | |
} | |
else if($cp <= 0x7ff){ | |
return pack("cc", | |
0b11000000 | (($cp >> 6) & 31), | |
0b10000000 | ($cp & 63) |
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 | |
$descriptorspec = array( | |
0 => fopen('php://stdin','r'), | |
1 => fopen('php://stdout','w'), | |
2 => array("file", "/tmp/error-output.txt", "a") | |
); | |
$tempfile = tempnam('/tmp','testing_'); | |
$cmd = getenv('EDITOR').' '.$tempfile; |
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 | |
abstract class GenericParser | |
{ | |
abstract public static function getTokens(); | |
public function convertTextToArray($data){ | |
$tokens = static::getTokens(); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<link rel="stylesheet" href="normalize.css"> | |
<style> | |
.flex { | |
height:200px; | |
margin-right:5px; | |
// DEFINES FLEX CONTEXT FOR IMMEDIATE CHILDREN |
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
{ | |
"Host": "http://127.0.0.1:5984", | |
"Patterns":{ | |
"GET":[ | |
"^/_all_db", | |
"^/b$", | |
"^/c" | |
], | |
"POST":[ | |
"^/db/" |
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 | |
$octave_command = "octave --no-window-system -q"; | |
$spec = array( | |
0 => array("pipe", "r"), | |
1 => array("pipe", "w"), | |
2 => array("file", "/tmp/octave_stderr.txt", "a") | |
); |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type blah struct { | |
Numbers []int | |
Astring string |
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
package main | |
import "fmt" | |
func closure(val string) func() { | |
return func() { | |
fmt.Println(val) | |
} | |
} |
NewerOlder