Skip to content

Instantly share code, notes, and snippets.

View tlvenn's full-sized avatar

Christian Meunier tlvenn

View GitHub Profile
@tlvenn
tlvenn / Fastfile
Created September 8, 2017 06:23 — forked from GoodMirek/Fastfile
Fastfile for Apple iOS build, resilient against Apple Developer Portal outages. Works with Xcode8.
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
mkfifo mylock.fifo
ETCDCTL_API=3 ./bin/etcdctl lock mylock >mylock.fifo &
pid=$!
if read lockname <mylock.fifo; then
echo holding lock with key $lockname
... do whatever ...
fi
kill $pid
wait $pid
// This file allows us to inspect the traffic going over the Native <-> JS bridge, and can be
// helpful for debugging. Setting this to true should never be committed to git
const ENABLE_BRIDGE_DEBUGGER = false; // <-- THIS SHOULD NOT BE TRUE IN MASTER!!!!
// if true, function arguments will get pretty printed
const PRETTY_PRINT = false;
// enable this if you want to ignore EVERY event, except for the ones that match the `FOCUSED_*`
// constants. If true, you configure what you want to see. If false, you configure what you DONT
// want to see.
import {Environment} from 'react-relay';
import invariant from 'invariant';
class RelayStore {
constructor() {
this._env = new Environment();
this._networkLayer = null;
this._taskScheduler = null;
}
This file has been truncated, but you can view the full file.
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.graphiqlWorkspace = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GraphiQLTab = undefined;
var _createClass = function () {
@tlvenn
tlvenn / iex.ex
Created February 6, 2017 02:07
Trace phase timings in Absinthe
:dbg.tracer()
:dbg.p(:all, [:call, :arity, :timestamp])
:dbg.tpl(Absinthe.Pipeline, :run_phase, 3,
[{[[{:"$1",:_}|:_],:_,:_],[],[{:message,:"$1"}]},
{[[:"$1"|:_],:_,:_],[],[{:message,:"$1"}]}])
defmodule Absinthe.Ecto.Resolution.Schema do
@moduledoc """
This module provides helper functions to resolve a GraphQL query into `Ecto.Query`.
"""
import Absinthe.Resolution.Helpers
import Ecto.Query
alias Absinthe.Resolution
alias Absinthe.Blueprint.Document.Field
@tlvenn
tlvenn / README.md
Created October 29, 2016 10:42 — forked from rbishop/README.md
A super simple Elixir server for sending Server Sent Events to the browser.

Generate a new Elixir project using mix and add cowboy and plug as dependencies in mix.exs:

  defp deps do
    [
      {:cowboy, "~> 1.0.0"},
      {:plug, "~> 0.8.1"}
    ]
  end
def index(conn, %{"event" => "true"}) do
conn = conn
|> put_resp_content_type("text/event-stream")
|> send_chunked(200)
{:ok, conn} = chunk(conn, ["data: ", JSON.encode!(Thermostat.Data.get()), "\n\n"])
Phoenix.Topic.subscribe self, "data"
data_updated(conn)
end
defp data_updated(conn) do
@tlvenn
tlvenn / component.js
Created June 22, 2016 12:36 — forked from capaj/component.js
react stateful function component
import React from 'react'
import {observer} from 'mobx-react'
import {observable} from 'mobx'
const state = observable({
value: 0
})
const Comp = (props) => {
return <div onClick={() => state.value++}>click to increase counter value: {state.value}</div>