Skip to content

Instantly share code, notes, and snippets.

@parweb
parweb / types.graphql
Created April 10, 2018 00:01
Mutations
type Location {
id: ID! @unique
lat: Float!
lng: Float!
street: String
postalCode: String
city: City
}
type City {
@parweb
parweb / autoChromium.desktop
Last active March 14, 2017 22:57
autorun chrome on pi
[Desktop Entry]
Type=Application
Exec=/usr/bin/chromium-browser --noerrdialogs --disable-session-crashed-bubble --disable-translate --disable-translate-new-ux --disable-infobars --kiosk url_entrypoint
Hidden=false
X-GNOME-Autostart-enabled=true
Name[en_US]=AutoChromium
Name=AutoChromium
Comment=Start Chromium when GNOME starts
@parweb
parweb / yolo.php
Last active March 2, 2017 10:16
yolo
<?php
echo _DB_SERVER_.' - '._DB_NAME_.' - '._DB_USER_.' - '._DB_PASSWD_.' - '._DB_PREFIX_;
@parweb
parweb / .block
Last active January 28, 2017 00:30 — forked from mbostock/.block
Chord Diagram
license: gpl-3.0
height: 961
border: no
@parweb
parweb / composer.json
Last active December 7, 2016 21:55
defer any code in PHP
{
"require": {
"opis/closure": "^2.1.0"
}
}
@parweb
parweb / test-railway.js
Created December 1, 2016 17:58
test-railway.js
const addOne = value => {
return value + 1;
};
const failIfOdd = value => {
return value + 1;
};
function railway ( chain ) {
return new Promise((resolve) => {
@parweb
parweb / input.php
Last active November 22, 2016 16:14
Do you know a better way ?
<?php
$input = array(
'data' => array(
'vehicles' => array(
0 => array(
'id' => '782',
'vin' => 'VF7SA9HD8DW660669',
'equipments' => array(
0 => array(
@parweb
parweb / variadic-generics.php
Created October 13, 2016 20:58 — forked from ramsey/variadic-generics.php
You may type-hint on variadic functions in PHP to enforce type on elements in the array
<?php
class Foo {}
$f1 = new Foo();
$f2 = new Foo();
$bar = function (Foo ...$foo) {
foreach ($foo as $f) {
echo get_class($f) . "\n";
}
@parweb
parweb / DataLoader.php
Last active July 17, 2016 01:22
Facebook/DataLoader for the PHP communauty on top of Icicle
<?php
namespace App\hissezhaut\DataLoader;
use App\hissezhaut\DataLoader\Types\Map;
use App\hissezhaut\DataLoader\Types\Options;
use App\hissezhaut\DataLoader\Types\Queue;
use Exception;
use Icicle\Awaitable as UPromise;
use Icicle\Awaitable\Promise;
@parweb
parweb / gist:08dd8a299d7f8d7860dc
Created January 8, 2016 21:54
Verifying that +parweb is my blockchain ID. https://onename.com/parweb
Verifying that +parweb is my blockchain ID. https://onename.com/parweb