Skip to content

Instantly share code, notes, and snippets.

View wmh's full-sized avatar
🎯
Focusing

Hunter Wu wmh

🎯
Focusing
  • Not available for hire.
  • Taipei 104
View GitHub Profile
@tarwn
tarwn / RAINBOWlog.js
Created March 13, 2014 02:08
Awesomify-er your console.log - extended from https://gist.github.com/LeaVerou/9518902
(function(){
var log = console.log;
console.log = function(str) {
var css = 'background-image: url("http://fc07.deviantart.net/fs70/f/2013/090/3/5/ocs____seine_unicorn_sprite_by_onisuu-d5zuuax.gif"), linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); background-repeat: no-repeat, no-repeat; padding-left: 20px; color: white; font-weight: bold; font-size: 12pt; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;';
var args = Array.prototype.slice.call(arguments);
args[0] = '%c ' + args[0];
args.splice(1,0,css);
return log.apply(console, args);
}
@LeaVerou
LeaVerou / RAINBOWlog.js
Created March 12, 2014 23:30
AWESOMEify your console.log()ing! Because life is too short to be black & white!!!!!!1111one
(function(){
var log = console.log;
console.log = function(str) {
var css = 'background: linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); color: white; font-weight: bold;';
var args = Array.prototype.slice.call(arguments);
args[0] = '%c' + args[0];
args.splice(1,0,css);
return log.apply(console, args);
}
@Jxck
Jxck / main.go
Last active August 31, 2017 10:27
interface of Go blog sample
package main
/*
Go のインタフェース設計
参考
https://code.google.com/p/go-wiki/wiki/GoForCPPProgrammers
http://jordanorelli.tumblr.com/post/32665860244/how-to-use-interfaces-in-go
http://research.swtch.com/interfaces
http://www.airs.com/blog/archives/277