Skip to content

Instantly share code, notes, and snippets.

View poying's full-sized avatar
🏠
I may be slow to respond.

Po-Ying Chen poying

🏠
I may be slow to respond.
View GitHub Profile
const R = require('ramda');
const Future = require('ramda-fantasy').Future;
// :: Int -> [Future a b] -> Future a [b]
// number of workers :: Int
// tasks to do :: [Future a b]
const batchParallel = R.curry((N, as) => {
if (0 === as.length || N < 1) {
return Future.of([]);
}
@conancat
conancat / attictv.jobs.md
Last active June 9, 2016 03:20
HIRING: Android, iOS, Backend/JavaScript developers and System Administrator. Find out more below!

HIRING: Android, iOS, Backend/JavaScript developers and System Administrator

Position: Full-time/Part-time

  • Roles: Android, iOS, Backend developers and System Administrator
  • Full-time and part-time positions available!

PHP 高階技術課程

本課程共分做四天教授,目標對象為已有二到三年以上 PHP 專案開發經驗的 PHP 開發者。

Day 1

  • 物件導向基礎
  • PHP 5 特色與語法
@simonh1000
simonh1000 / ArchictectureErrorHandler.elm
Created September 23, 2015 08:06
Elm architecture example with Http (Json parsing) error handling
module ArchictectureErrorHandler where
import Text exposing (fromString)
import String
import Json.Decode as Json exposing (..)
import StartApp exposing (start)
import Html exposing (..)
import Http exposing (get, Error)
import Effects exposing (Effects)
@victusfate
victusfate / watercanvas.js
Created June 11, 2011 14:07
water canvas by Almer Thie http://code.almeros.com
/*
* Water Canvas by Almer Thie (http://code.almeros.com).
* Description: A realtime water ripple effect on an HTML5 canvas.
* Copyright 2010 Almer Thie. All rights reserved.
*
* Example: http://code.almeros.com/code-examples/water-effect-canvas/
* Tutorial: http://code.almeros.com/water-ripple-canvas-and-javascript
*/
@bensu
bensu / Dropdown.elm
Created August 19, 2015 19:52
Dropdown Component in Elm
module Dropdown where
import List exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick, onBlur)
-- MODEL
@mgold
mgold / using_mailboxes_in_elm.md
Last active March 24, 2020 16:05
Using Mailboxes in Elm: a tutorial blog post

Using Mailboxes in Elm

Max Goldstein | July 30, 2015 | Elm 0.15.1

In Elm, signals always have a data source associated with them. Window.dimensions is exactly what you think it is, and you can't send your own events on it. You can derive your own signals from these primitives using map, filter, and merge, but the timing of events is beyond your control.

This becomes a problem when you try to add UI elements. We want to be able to add checkboxes and dropdown menus, and to receive the current state of these elements as a signal. So how do we do that?

The Bad Old Days

@shazron
shazron / sim-run.sh
Created October 25, 2011 21:53
Run Xcode Simulator project from the command line
#!/bin/bash
#
# Build and iPhone Simulator Helper Script
# Shazron Abdullah 2011
#
# WARN: - if your .xcodeproj name is not the same as your .app name,
# this won't work without modifications
# - you must run this script in where your .xcodeproj file is
PROJECTNAME=$1
@domenic
domenic / event-emitter.js
Last active March 11, 2022 15:25
Revealing constructor pattern event-emitter
// This event emitter emits events, but reserves the right to publish events to
// for its creator. It uses a WeakMap for true encapsulation.
const eesToEventMaps = new WeakMap();
export default class EventEmitter {
constructor(publisher) {
const eventMap = Object.create(null);
eesToEventMaps.set(this, eventMap);
@Rob--W
Rob--W / html5-formdata-polyfilll.js
Created May 27, 2014 22:07
FormData polyfill for Web Workers.
/*
* FormData for XMLHttpRequest 2 - Polyfill for Web Worker
* (c) 2014 Rob Wu <rob@robwu.nl>
* License: MIT
* - append(name, value[, filename])
* - XMLHttpRequest.prototype.send(object FormData)
*
* Specification: http://www.w3.org/TR/XMLHttpRequest/#formdata
* http://www.w3.org/TR/XMLHttpRequest/#the-send-method
* The .append() implementation also accepts Uint8Array and ArrayBuffer objects