Skip to content

Instantly share code, notes, and snippets.

View jaytaph's full-sized avatar
:shipit:
Calculating pi

Joshua Thijssen jaytaph

:shipit:
Calculating pi
View GitHub Profile
Array
(
[name] => /1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/businessCategory=Private Organization/serialNumber=2158113/C=US/postalCode=94043/ST=California/L=Mountain View/street=350 Ellis Street/O=Symantec Corporation/OU=Infrastructure Operations/CN=knowledge.verisign.com
[subject] => Array
(
[UNDEF] => Array
(
[0] => US
[1] => Delaware
)
<?php
require_once "vendor/autoload.php";
use Symfony\Component\Config;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Yaml\Yaml;
class MyConfig implements ConfigurationInterface
{
search paths: [['.', './modules', '/usr/share/saffire/modules']]
/wwwroot/main.sf (namespace: '::')
----------------------------------------------
import io;
import framework;
import notexisting;
io.print("hello world");
➜ saffire git:(namespacing) ✗ ./build/release/saffire hello.sf
Hello world!
Hi Bar!
_ _
| | (_)
_____ _____ ___ _ __ | |_ _ ___ _ __
/ _ \ \/ / __/ _ \ `_ \| __| |/ _ \| `_ \
| __/> < (_| __/ |_) | |_| | (_) | | | |
\___/_/\_\___\___| .__/ \__|_|\___/|_| |_|
| |
namespace Application;
class Controller {
protected $app;
function __construct($app) {
$this->app = $app;
}
interface DataInterface {
public method getData();
}
class NullableData implements DataInterface {
}
class chartA implements DataInterface {
}
class chartB implements DataInterface {
import io;
import file;
f = file.open("test.txt", "r");
io.print("FILE 1: ", f.path(), " => ", f.fileNo(), "\n");
f2 = file.open("test.txt", "r");
io.print("FILE 2: ", f2.path(), " => ", f2.fileNo(), "\n");
io.dump(f.stat());
SAFFIRE_MODULE_METHOD(file, write) {
t_file_object *file_obj = (t_file_object *)self;
t_string_object *str_obj;
if (! object_parse_arguments(SAFFIRE_METHOD_ARGS, "s", &str_obj)) {
return NULL;
}
long bytes_written = fwrite(str_obj->data.value->val, 1, str_obj->data.value->len, file_obj->data.fp);
#include "saffire.h"
#include <stdio.h>
Saffire::Object greet_method(Saffire::Arguments &args) {
Saffire::String s;
args.parse("s", &s);
return Saffire::String( std::string("hello ") + s.value() );
}
JSON 1: {"foo":"bar","foo2":"bar2","foo3":"bar3"}
JSON 2: {"foo":"bar","foo2":"bar2","foo3":"bar3"}
JSON 3: { "foo": "bar", "foo2": "bar2", "foo3": "bar3" }
JSON 4: {"foo":"bar","foo2":"bar2","foo3":"bar3"}
JSON 4: {
"foo":"bar",
"foo2":"bar2",
"foo3":"bar3"
}
JSON 5: {