Skip to content

Instantly share code, notes, and snippets.

View huobazi's full-sized avatar
🎯
Focusing

Marble Wu huobazi

🎯
Focusing
View GitHub Profile
@huobazi
huobazi / digital_ocean_setup.md
Created November 4, 2015 02:14 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@huobazi
huobazi / meta-tags.md
Last active September 9, 2015 05:45 — forked from balduran/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@huobazi
huobazi / settings.yml
Last active August 29, 2015 14:12 — forked from quanon/settings.yml
lodge:
per_size: 30
right_list_size: 10
slack:
defaults: &defaults
url: https://slack.com
channel: #channel
# トークンは Slack API のページで発行できます。
token: my_token
# Docs: http://smartinez87.github.io/exception_notification/
module ExceptionNotifier
class SlackNotifier
def initialize(options)
# do something with the options...
@channel = options[:channel] || '#somechannel'
@team = options[:team] || 'someteam'
@token = options[:token] || '__top_secret_token__'
@username = options[:username] || 'somename'
@huobazi
huobazi / fixIE.js
Last active August 29, 2015 14:11 — forked from c0untd0wn/fixIE.js
'use strict';
// Add ECMA262-5 method binding if not supported natively
//
if (!('bind' in Function.prototype)) {
Function.prototype.bind= function(owner) {
var that= this;
if (arguments.length<=1) {
return function() {
return that.apply(owner, arguments);
@huobazi
huobazi / HTML-tags.md
Last active August 29, 2015 14:11 — forked from yisibl/HTML-tags.md

常用的 HTML 头部标签

详细介绍参见原文:yisibl/blog#1

<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
    <meta charset='utf-8'> <!-- 声明文档使用的字符编码 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用 IE 最新版本和 Chrome -->
@huobazi
huobazi / proload.js
Last active August 29, 2015 14:11 — forked from matdombrock/proload.js
//USES JQUERY
var slides = [
"img/Lighthouse.jpg",
"img/Desert.jpg",
"img/Jellyfish.jpg"
];
$(slides).each(function () {
$('<img />').attr('src',this).appendTo('body').css('display','none');
});
@huobazi
huobazi / Order.cs
Last active August 29, 2015 14:11 — forked from dinowang/Order.cs
public enum Order
{
Ascending,
Descending
}
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
ActiveSupport.on_load(:action_controller) do
after_action :set_csrf_cookie_for_angular_js
define_method :set_csrf_cookie_for_angular_js do
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
end
private :set_csrf_cookie_for_angular_js
define_method :verified_request_with_angular_header? do
verified_request_without_angular_header? || form_authenticity_token == request.headers['X-XSRF-Token']