Skip to content

Instantly share code, notes, and snippets.


Antoine Niek zapo

View GitHub Profile
zapo / chat.js
Created Oct 20, 2018
WebRTC channel communication sample (same browser signaling through localStorage)
View chat.js
const connection = new RTCPeerConnection({ iceServers: [{ urls: '' }] });
connection.onicecandidate = (e) => {
if (e.candidate) {
localStorage.setItem('candidate', JSON.stringify(e.candidate));
connection.oniceconnectionstatechange = (e) => {

Keybase proof

I hereby claim:

  • I am zapo on github.
  • I am zapo ( on keybase.
  • I have a public key ASCgQBKsRiEbgt4eVyNEcWM3z0k8f945UREIgtxBH4reyQo

To claim this, I am signing this object:

View travis-rebuild
#!/usr/bin/env bash
## -*- sh-basic-offset: 2 -*-
set -o errexit -o nounset -o pipefail
BASENAME=$(basename "$0")
eval "$(docopts -A args -V - -h - : "$@" <<EOF
zapo / affirmation
Created Jun 25, 2015
MuleSoft Contributor Agreement Acceptance by Antoine Niek
View affirmation
I, Antoine Niek, have read and do accept the MuleSoft Contributor Agreement
Accepted on Thu Jun 25 2015 09:53:58 GMT-0400 (EDT)
zapo / todotxt-podio.rb
Last active Aug 29, 2015
Podio tasks sync with todotxt
View todotxt-podio.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'ostruct'
require 'yaml'
require 'active_support'
require 'active_support/core_ext'
require 'podio'
def usage
STDOUT.puts " Usage: #{ENV['TODO_SH']} podio <option>"
zapo / validations.rb
Created Jul 30, 2014
Validations test helper
View validations.rb
module Helpers
module Validations
def assert_valid_url url
assert_match URI::regexp(%w(http https)), url, "\"#{url}\" isn't a valid URL"
def assert_validated_presence object, attribute, success_val = "not blank", expected_msg = :blank
assert_validated object, attribute,
# plagiarism of
# without backbone dependency
class exports.Rule
constructor: (rule) ->
@actions = rule.actions
@conditions = rule.conditions ? {}
@subjects = rule.subjects
@can = !!rule.can
zapo / dupable.rb
Last active Aug 29, 2015
View dupable.rb
module Concerns
module Dupable
def duplicate
# copy self with attributes only, includes belongs_to associations
duplicate = self.dup
# copy all has_many associations...
# reject through target associations, we only want to duplicate the association models
self.class.reflect_on_all_associations(:has_many).select { |a| a.through_reflection.nil? }.each do |assoc|
View time_zone_model.rb
class TimeZoneModel
class ZoneProxy
attr_reader :target
def initialize target
@target = target
def name
You can’t perform that action at this time.