Skip to content

Instantly share code, notes, and snippets.

View synr's full-sized avatar

synr

View GitHub Profile
@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);
anonymous
anonymous / my.css
Created November 14, 2016 23:26
CSS Gradient Animation
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%}
    50%{background-position:100% 56%}
    100%{background-position:0% 45%}
@synr
synr / share this page with markdown link format to plurk
Last active October 20, 2016 08:49
用 Markdown 連結格式分享目前的網頁到噗浪(Plurk)[自動切換電腦版/行動版網頁的寫法](HTML a tag + JavaScript)
@DingWeizhe
DingWeizhe / 寶寶.js
Last active March 8, 2017 14:05
新增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 = {
@jamesliu96
jamesliu96 / damoo-ytb.js
Last active April 23, 2017 03:41
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.
package main
import (
"encoding/json"
"fmt"
"github.com/gorilla/mux"
"net/http"
"os"
)
@hdragomir
hdragomir / sm-annotated.html
Last active June 13, 2024 03:01
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);
@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@sergiotapia
sergiotapia / md5-example.go
Last active December 5, 2023 03:53
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))
}
@voluntas
voluntas / trello.rst
Last active August 20, 2020 14:55
Trello のススメ