Skip to content

Instantly share code, notes, and snippets.

View synr's full-sized avatar

synr

View GitHub Profile
@synr
synr / damoo-ytb.js
Created February 25, 2017 17:23 — forked from jamesliu96/damoo-ytb.js
YouTube extension script for Live stream videos
/*! Damoo v2.1.9 | Copyright (c) 2015-2016 James Liu | Released under the MIT license */
;(function(b){var d=function(a,c,h,b){if(!(this instanceof d))return new d(a,c,h,b);this.canvas=new k(a,c,h,b);this.thread=new g(h)};d.version="v2.1.9";d.dom=b.document;var p=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||b.oRequestAnimationFrame||function(a){return setTimeout(a,17)},q=b.cancelAnimationFrame||b.mozCancelAnimationFrame||b.webkitCancelAnimationFrame||b.webkitCancelRequestAnimationFrame||b.msCancelAnimationFrame||b.oCancelAnimationFrame||
function(a){clearTimeout(a)};d.prototype.show=function(){this.canvas.parent.appendChild(this.canvas.layer);return this};d.prototype.hide=function(){this.canvas.parent.removeChild(this.canvas.layer);return this};d.prototype.emit=function(a){"string"===typeof a&&(a={text:a});var c=a,b=this.canvas.font,f=d.dom.createElement("canvas"),e=f.getContext("2d");e.font=b;f.width=e.measureText(c.text).width;f.height=1.5*b.
@synr
synr / damoo-ytb.js
Created February 25, 2017 17:23 — forked from jamesliu96/damoo-ytb.js
YouTube extension script for Live stream videos
/*! Damoo v2.1.9 | Copyright (c) 2015-2016 James Liu | Released under the MIT license */
;(function(b){var d=function(a,c,h,b){if(!(this instanceof d))return new d(a,c,h,b);this.canvas=new k(a,c,h,b);this.thread=new g(h)};d.version="v2.1.9";d.dom=b.document;var p=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||b.oRequestAnimationFrame||function(a){return setTimeout(a,17)},q=b.cancelAnimationFrame||b.mozCancelAnimationFrame||b.webkitCancelAnimationFrame||b.webkitCancelRequestAnimationFrame||b.msCancelAnimationFrame||b.oCancelAnimationFrame||
function(a){clearTimeout(a)};d.prototype.show=function(){this.canvas.parent.appendChild(this.canvas.layer);return this};d.prototype.hide=function(){this.canvas.parent.removeChild(this.canvas.layer);return this};d.prototype.emit=function(a){"string"===typeof a&&(a={text:a});var c=a,b=this.canvas.font,f=d.dom.createElement("canvas"),e=f.getContext("2d");e.font=b;f.width=e.measureText(c.text).width;f.height=1.5*b.
@synr
synr / md5-example.go
Created December 30, 2016 12:54 — forked from sergiotapia/md5-example.go
Golang - How to hash a string using MD5.
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}
@synr
synr / ttf2woff2.md
Created December 8, 2016 08:06 — forked from sergejmueller/ttf2woff2.md
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@synr
synr / sm-annotated.html
Created December 7, 2016 21:07 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@synr
synr / 寶寶.js
Created November 18, 2016 17:43 — forked from DingWeizhe/寶寶.js
新增line的功能
var fs = require('fs'),
http = require('http'),
https = require('https'),
express = require('express'),
bodyParser = require('body-parser'),
request = require('request'),
crypto = require('crypto'),
FBToken = '',
port = 443,
options = {
@synr
synr / my.css
Created November 14, 2016 23:56 — forked from anonymous/my.css
CSS Gradient Animation
background: linear-gradient(180deg, #ea0b0b, #ea520b, #d7c005, #52a82a, #289d27, #2ab793, #28949f, #2a97b7, #2a97b7, #2a46b7, #402ab7, #5f2ab7, #782ab7, #912ab7, #b02ab7, #b72a93, #b72a6d, #b72a48, #b72a2a);
background-size: 3800% 3800%;
-webkit-animation: AnimationName 53s ease infinite;
-moz-animation: AnimationName 53s ease infinite;
-o-animation: AnimationName 53s ease infinite;
animation: AnimationName 53s ease infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 78%}
    50%{background-position:100% 23%}
    100%{background-position:0% 78%}
@synr
synr / 彩虹.css
Last active November 14, 2016 23:55 — forked from anonymous/my.css
CSS Gradient Animation
/* https://www.gradient-animator.com */
background: linear-gradient(180deg, #ea0b0b, #ea520b, #d7c005, #52a82a, #289d27, #2ab793, #28949f, #2a97b7, #2a97b7, #2a46b7, #402ab7, #5f2ab7, #782ab7, #912ab7, #b02ab7, #b72a93, #b72a6d, #b72a48, #b72a2a);
background-size: 3800% 3800%;
-webkit-animation: AnimationName 60s ease 2s infinite;
-moz-animation: AnimationName 60s ease 2s infinite;
-o-animation: AnimationName 60s ease 2s infinite;
animation: AnimationName 60s ease 2s infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 97%}
@synr
synr / 彩虹背景XD.css
Created November 14, 2016 23:26 — forked from anonymous/my.css
CSS Gradient Animation
/* https://www.gradient-animator.com/ */
background: linear-gradient(136deg, #b43c0f, #903e07, #725808, #5d5f0d, #729618, #7aa11b, #276b18, #19692d, #0e9862, #0c7d52, #0c687d, #0c227d, #0f0c7d, #360c7d, #4a0c7d, #5e0c7d, #720c7d, #7d0c65, #7d0c47, #7d0c24);
background-size: 4000% 4000%;
-webkit-animation: AnimationName 16s ease infinite;
-moz-animation: AnimationName 16s ease infinite;
-o-animation: AnimationName 16s ease infinite;
animation: AnimationName 16s ease infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 45%}
@synr
synr / get_bootswatch_theme_name.js
Last active October 21, 2016 16:41
2016.10.21 判別目前的 bootstrap 佈景主題
//2016.10.21 判別 theme-color https://blog.gtwang.org/web-development/android-chrome-browser-theme-color-support/
function get_theme_color(){
var get_color = '';
var x = document.getElementsByTagName('meta');
var i = x.length;
while (i--) {
if (x[i].name == 'theme\-color') {
get_color = x[i].content;
return get_color;
}