Skip to content

Instantly share code, notes, and snippets.

@weimeng
weimeng / keybase.md
Created August 23, 2015 22:30
Keybase proof of GitHub identity

Keybase proof

I hereby claim:

  • I am weimeng on github.
  • I am weimeng (https://keybase.io/weimeng) on keybase.
  • I have a public key whose fingerprint is 5521 32A3 1CEE 0CB8 DF20 4D84 D4DB 649C 123A 1931

To claim this, I am signing this object:

@weimeng
weimeng / Safety pig
Last active August 29, 2015 14:12 — forked from crittelmeyer/Safety pig
_
_._ _..._ .-', _.._(`))
'-. ` ' /-._.-' ',/
) \ '.
/ _ _ | \
| a a / |
\ .-. ;
'-('' ).-' ,' ;
'-; | .'
\ \ /
@weimeng
weimeng / spec_helper.rb
Last active December 21, 2015 10:09
If you're using Coveralls, you don't need to wait for your CI to push coverage results to Coveralls.io! Just set an additional SimpleCov formatter to output the coverage files locally. Don't forget to add `/coverage` to `.gitignore`.
require 'simplecov'
require 'coveralls'
require 'codeclimate-test-reporter'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
Coveralls::SimpleCov::Formatter,
SimpleCov::Formatter::HTMLFormatter,
CodeClimate::TestReporter::Formatter
]
SimpleCov.start 'rails'
// Off canvas layout CSS/JS provided by or adapted from work by Jason
// Weaver and Luke Wroblewski Requires globals.css grid.css
body.off-canvas
padding: 0
margin: 0
.container
width: 100%
@weimeng
weimeng / gist:5715537
Last active December 18, 2015 03:08
#FreeMyInternet blackout for Wordpress
<div id="black-out-protest" align="center" style="position:fixed;width:100%;height:100%;top:0;right:0;background:black;z-index:1000;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=90)';filter:alpha(opacity=90);-moz-opacity:.9;opacity:.9;text-align:center;"><a href="http://www.freemyinternet.com/"><img style="max-width:100%;" src="http://freemyinternet.com/free_my_internet.jpg" /></a><div><a href="#" onClick="var element = document.getElementById('black-out-protest'); console.log(element); element.parentNode.removeChild(element);">Close this message</a></div><div style="color: #FFF; font-size: 16px; width: 600px; margin: 0 auto; text-align: justify; line-height: 1.5em;"><p>Dear Readers,</p><p>On May 28, the Media Development Authority (MDA) -- the same government statutory board that regulates games in Singapore -- announced that online news sites with at least 50,000 unique visits per month from Singapore will require a licence to operate and must pay a bond of S$50,000.</p><p>It is No Game No Tal
@weimeng
weimeng / application.html.slim
Created March 30, 2013 21:11
Cleaner version of the HTML5 Boilerplate Slim Ruby on Rails application.html template for Zurb Foundation 4.0. Thanks to https://gist.github.com/helloluis/1183106/#comment-375706.
doctype html
/ paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
/[if lt IE 7]
html.ie6 lang="en"
/[if IE 7]
html.ie7 lang="en"
/[if IE 8]
html.ie8 lang="en"
/[if IE 9]
html.ie9 lang="en"
@weimeng
weimeng / gist:4527826
Last active December 11, 2015 02:08
Semantic helpers for responsive website implementations using bootstrap-sass. Specifically adds responsive replacements for the makeRow() and makeColumn() mixins included in Twitter Bootstrap.
@mixin row() {
margin-left: $gridGutterWidth * -1;
@media (max-width: 767px) { margin-left: 0; }
@media (min-width: 768px) and (max-width: 979px) { margin-left: $gridGutterWidth768 * -1; }
@media (min-width: 1200px) { margin-left: $gridGutterWidth1200 * -1; }
@include clearfix();
}
@mixin column($columns: 1, $offset: 0) {
float: left;