Skip to content

Instantly share code, notes, and snippets.

View CYBAI's full-sized avatar
🇹🇼
λf. (λx. f (x x)) (λx. f (x x))

cybai (Haku) CYBAI

🇹🇼
λf. (λx. f (x x)) (λx. f (x x))
View GitHub Profile
@kylelemons
kylelemons / gotour-69.go
Created October 7, 2011 01:55
My solution to Go Tour #69 - Web Crawler
package main
import (
"os"
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
@coodoo
coodoo / v3.hs
Created October 27, 2017 06:14
Convert list to tree using State monad, in a suck less manner 😅
module Bar () where
import Data.Maybe
import Control.Monad.State
import qualified Data.Map as M
data Item = Item {
sId :: String,
pId :: String,
value :: [Char],
children :: [String]
{-# OPTIONS --type-in-type #-}
-- Taken from http://www.cs.nott.ac.uk/~psztxa/g53cfr/l20.html/l20.html
module _ where
open import Agda.Builtin.Unit
open import Agda.Builtin.Equality
data ⊥ : Set where
@Shoom
Shoom / gist:9622e6e09ca6be63f98f
Last active July 19, 2018 11:52
CSSconf EU 2014
{
"cssconf": {
"location": {
"date": "September 12, 2014",
"country": "Germany",
"city": "Berlin",
"venue": "Radialsystem V",
"lat": 52.51039,
"long": 13.42864
},
-- programming
data Nat : Set where
zero : Nat
suc : Nat → Nat
_+_ : Nat → Nat → Nat
zero + n = n
suc m + n = suc (m + n)
// <copyright file="LeastRecentlyUsedCache.cs" company="http://www.sinbadsoft.com">
// Copyright (c) Chaker Nakhli 2013
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
// License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
// applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
// governing permissions and limitations under the License.
// </copyright>
// <author>Chaker Nakhli</author>
// <email>Chaker.Nakhli@sinbadsoft.com</email>
@rayshih
rayshih / Main.purs
Created September 2, 2018 18:24
Typelevel N Queen in PureScript
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
import Data.Ord (abs)
import Data.List (List(Nil), range, (:), length)
import Data.Traversable (traverse)
@benschw
benschw / Dockerfile
Last active October 1, 2018 18:30
MySQL Docker Container
FROM ubuntu
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get -y install mysql-client mysql-server

Building a GraphQL API in Rails - Part 1

This is a series blog post cover above three topics of GraphQL:

  1. About GraphQL
  2. Building a basic API with Rails
  3. Some best practices

GraphQL is not a new thing, it already exist for a while, the reason I decide to investigate it is because Github released their GraphQL API alpha currently. We know Github has been a very good company for a long time, their RESTful API also becomes some kind of standard for developers, so it's pretty interesting to see what’s new they've been released.

@topheman
topheman / jspm.travis.setup.md
Created August 4, 2015 18:49
Travis setup of Github token for jspm