Skip to content

Instantly share code, notes, and snippets.

Avatar

Maxime COLIN maximecolin

View GitHub Profile
@maximecolin
maximecolin / graphql.php
Created Jun 12, 2018
GraphQL multiple mutation test
View graphql.php
<?php
// Test this using following command
// php -S localhost:8080 ./graphql.php &
// curl http://localhost:8080 -d '{"query": "query { echo(message: \"Hello World\") }" }'
// curl http://localhost:8080 -d '{"query": "mutation { sum(x: 2, y: 2) }" }'
require_once __DIR__ . '/vendor/autoload.php';
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\Type;
use GraphQL\Type\Schema;
View Kernel.php
<?php
namespace App;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface;
@maximecolin
maximecolin / all.yml
Last active Sep 14, 2017
Telegraf + InfluxDB + Grafana ansible provisoning with manala.io
View all.yml
_env: prod
##############
# Apt Config #
##############
manala_apt_preferences:
- influxdb@influxdata
- telegraf@influxdata
- grafana@grafana
@maximecolin
maximecolin / System.json
Created Nov 17, 2016
Grafana System Dashboard
View System.json
{
"__inputs": [
{
"name": "DS_INFLUXDB",
"label": "influxdb",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
@maximecolin
maximecolin / System.json
Created Nov 17, 2016
Grafana System Dashboard
View System.json
{
"__inputs": [
{
"name": "DS_INFLUXDB",
"label": "influxdb",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
View gist:75cbe517de5ab62a0bcac8bf457c92b7
/**
* Has join
*
* @param string $root
* @param string $relation
*
* @return bool
*/
View gist:db8d3d9c36f304fe8e7a
Verifying that +mcbinome is my blockchain ID. https://onename.com/mcbinome
@maximecolin
maximecolin / photos.sh
Created Dec 21, 2015
Stop Apple Photos from Auto Launching in OS X with One Command
View photos.sh
//Stop Apple Photos from Auto Launching in OS X with One Command
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool NO
@maximecolin
maximecolin / gzip.conf
Last active Sep 9, 2015 — forked from Tom32i/gzip.conf
GZIP config for Nginx
View gzip.conf
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_min_length 256;
gzip_comp_level 6;
View orthodromic_distance.sql
CREATE OR REPLACE FUNCTION orthodromic_distance(point, point) RETURNS float AS $_$
SELECT acos(sin(radians($1[0])) * sin(radians($2[0])) + cos(radians($1[0])) * cos(radians($2[0])) * cos(radians($2[1]) - radians($1[1]))) * 6371.0;
$_$ LANGUAGE sql IMMUTABLE;
You can’t perform that action at this time.