Skip to content

Instantly share code, notes, and snippets.

View boostbob's full-sized avatar
💣
Born to try

Bob Wang boostbob

💣
Born to try
  • boostbob
  • Chengdu, Sichuan, China
View GitHub Profile
@boostbob
boostbob / Instructions.sh
Created May 21, 2018 10:29 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@boostbob
boostbob / population-try
Created November 22, 2017 07:35 — forked from aikin/population-try
mongoose-population
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = mongoose.Types.ObjectId;
console.log('Running mongoose version %s', mongoose.version);
var UserSchema = new Schema({
name : String,
posts : [{
type : Schema.Types.ObjectId,
@boostbob
boostbob / README.md
Created July 25, 2017 03:22 — forked from dariocravero/README.md
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
@boostbob
boostbob / will_paginate.rb
Created December 14, 2013 08:29 — forked from isaacbowen/will_paginate.rb
Custom WillPaginate LinkRender
# config/initializers/will_paginate.rb
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= BootstrapLinkRenderer
super.try :html_safe
end
class BootstrapLinkRenderer < LinkRenderer
@boostbob
boostbob / md-menu.html
Created December 5, 2013 05:27 — forked from cloudsben/md-menu.html
Gengerate Makrdown Tree
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/googlecode.min.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
$(document).ready(function(){
$("h2,h3,h4,h5,h6").each(function(i,item){
var tag = $(item).get(0).localName;
module BootstrapPaginationHelper
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
protected
def page_number(page)
unless page == current_page
link(page, page, :rel => rel_value(page))
else
link(page, "#", :class => 'active')
end
@boostbob
boostbob / gist:5715239
Created June 5, 2013 16:25
foundation interchange named queries
named_queries : {
'default' : 'only screen and (min-width: 1px)',
small : 'only screen and (min-width: 768px)',
medium : 'only screen and (min-width: 1280px)',
large : 'only screen and (min-width: 1440px)',
landscape : 'only screen and (orientation: landscape)',
portrait : 'only screen and (orientation: portrait)',
retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),'
+ 'only screen and (min--moz-device-pixel-ratio: 2),'
+ 'only screen and (-o-min-device-pixel-ratio: 2/1),'
@boostbob
boostbob / gist:5715171
Created June 5, 2013 16:16
foundation interchange resize
resize : function () {
var cache = this.cache;
for (var uuid in cache) {
if (cache.hasOwnProperty(uuid)) {
var passed = this.results(uuid, cache[uuid]);
if (passed) {
this.settings.directives[passed
.scenario[1]](passed.el, passed.scenario[0]);
@boostbob
boostbob / gist:5715065
Created June 5, 2013 16:02
foundation interchange ie load callback fix
loaded : function (image, last, callback) {
function loaded () {
callback(image[0], last);
}
function bindLoad () {
this.one('load', loaded);
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
var src = this.attr( 'src' ),