Skip to content

Instantly share code, notes, and snippets.

View yggie's full-sized avatar

Bryan Yap yggie

  • Co-Founder & CTO of Amata World
  • London, UK
View GitHub Profile
@yggie
yggie / gist:40ad6509c5cf2e85feb8
Last active December 29, 2016 06:03
YouTube and HTML5 Video Player Embedding With Limited Playable Videos
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="https://code.jquery.com/jquery-2.1.1.js"></script>
</head>
<body>
<video width="500" height="281" controls>
<source src="http://download.wavetlan.com/SVV/Media/HTTP/H264/Talkinghead_Media/H264_test1_Talkinghead_mp4_480x360.mp4" type="video/mp4" />
@yggie
yggie / 256-colors.py
Last active August 29, 2015 14:18
Show 256 Terminal Colors with Python
#!/usr/bin/env python
# heavily influenced by:
# https://askubuntu.com/questions/27314/script-to-display-all-terminal-colors
import sys
foreground_only = "-f" in sys.argv[1:] or "--fg-only" in sys.argv[1:]
write = sys.stdout.write
for fgbg in range(38, 48):
@yggie
yggie / experimenting_with_ports.rb
Last active August 29, 2015 14:18
Experimenting with Ports
class Port
attr_accessor :output_port
def initialize(inner_port = nil)
inner_port.output_port = self if inner_port
@inner_port = inner_port
end
def perform(*args)
@inner_port.perform(*args)