Skip to content

Instantly share code, notes, and snippets.

View jiangtao's full-sized avatar
:octocat:
但行好事,也问前程。Up!Up!Up!

jiangtao

:octocat:
但行好事,也问前程。Up!Up!Up!
View GitHub Profile
@jiangtao
jiangtao / app.js
Created March 28, 2014 07:44 — forked from nachiket-p/app.js
if (Meteor.is_client) {
var userName = "PatelNachiket";
Template.hello.greeting = function () {
return "Fetch recent tweets from Twitter stream of user : " ;
};
Template.hello.events = {
'click #fetchButton' : function () {
console.log("Recent tweets from stream!");
$('#fetchButton').attr('disabled','true').val('loading...');

Git常用备忘.md

引自:http://blogread.cn/it/article/6282?f=sa

配置

git config --global user.name "robbin"  
git config --global user.email "fankai@gmail.com"
git config --global color.ui true
@jiangtao
jiangtao / learn.coffee
Last active August 29, 2015 14:09
coffee script 学习笔记
# 变量
number = 2
str = '4'
number = 1 if str
# 变量 数组和objecet处理
[a, b, c] = [1, 2, 3]
{key1, key2} = {key1: 'a', key2: 'b'}
# 方法
@jiangtao
jiangtao / vimdiff.md
Last active August 29, 2015 14:18 — forked from mattratleph/vimdiff.md

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@jiangtao
jiangtao / index.html
Last active August 29, 2015 14:19
jquery namespace test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>jquery namespace test</title>
</head>
<body>
<div id="container">
<div class="namespace1">
<div class="box">box1</div>
<?php
$fileName = $_FILES['afile']['name'];
$fileType = $_FILES['afile']['type'];
$fileContent = file_get_contents($_FILES['afile']['tmp_name']);
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent);
$json = json_encode(array(
'name' => $fileName,
'type' => $fileType,
'dataUrl' => $dataUrl,
@jiangtao
jiangtao / FIle.sublime-settings.json
Last active August 29, 2015 14:26 — forked from etrepat/FIle.sublime-settings.json
Sublime Text 2 - My Settings
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overriden in the platform
// specific settings file, for example, "Base File (Linux).sublime-settings".
// Because of this, setting them here will have no effect: you must set them
// in your User File Preferences.
"font_face": "Monaco",
"font_size": 12,
@jiangtao
jiangtao / javascript_with_promises.md
Last active August 29, 2015 14:27
翻译《Javascript with Promises》

翻译中...

@jiangtao
jiangtao / cors-nginx.conf
Created December 29, 2015 15:43 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#