Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

mofelee

🎯
Focusing
Block or report user

Report or block mofelee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mofelee
mofelee / javascript_resources.md
Last active Aug 29, 2015 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.
View javascript_resources.md

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@mofelee
mofelee / css_resources.md
Last active Aug 29, 2015 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.
View css_resources.md

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

View nginx.conf
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
View promises.js
/*
* A quick example of how to use Bluebird and Q to conjure your own promises
*
* Everything going on here is explained further in the following video:
* http://youtu.be/OU7WuVGSuZw?list=PLT-DLWOBKbB4dZ83I_7Ca-sUTvorckG-E
*
*/
// Import node modules
var Q = require('q');
View minimongoInspectorHelper.js
showTable = function(tableName){
var count = 0;
return Tracker.autorun(function(){
// console.clear();
console.table(window[tableName].find().fetch());
count++;
console.log('' + count + '次刷新', Date())
@mofelee
mofelee / offlineInstallMeteor.sh
Last active Aug 29, 2015
离线安装meteor--使用前先把安装包放在同一个文件夹里
View offlineInstallMeteor.sh
#!/bin/sh
# This is the Meteor install script!
#
# Are you looking at this in your web browser, and would like to install Meteor?
# Just open up your terminal and type:
#
# curl https://install.meteor.com/ | sh
#
# Meteor currently supports:
@mofelee
mofelee / start.sh
Created Aug 4, 2015
安装postgresql(ubuntu14.04)
View start.sh
#!/bin/sh
locale-gen zh_CN.UTF-8
apt-get update
echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' > /etc/apt/sources.list.d/pgdg.list
# add key
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
apt-key add -
apt-get update
@mofelee
mofelee / pg.md
Last active Aug 29, 2015
连接用ssh连接到远程postgresql数据库
View pg.md

配置和连接

pg_hba.conf

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5

映射远程端口到本地

ssh -L 63333:localhost:5432 root@pg.mofe.me -f -N

@mofelee
mofelee / mime.types
Last active Sep 12, 2015 — forked from zeroasterisk/mime.types
nginx config: /etc/nginx/mime.types
View mime.types
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
application/rss+xml rss;
@mofelee
mofelee / center.html
Last active Sep 23, 2015
把一个层定位在屏幕中间
View center.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>层定位在屏幕中间</title>
<style type="text/css" media="screen">
*{margin:0;padding:0;}
body,html{height:100%;overflow:hidden;}
.body{height:100%;overflow:auto;}
You can’t perform that action at this time.