Skip to content

Instantly share code, notes, and snippets.

root = true
[*.js]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = double
spaces_around_operators = true
space_after_control_statements = true
@josephj
josephj / layout.sass
Last active December 18, 2015 08:48
/*
* Layout system.
*
* .grid-full - 1 column
* .grid-nav - 2 columns
* .grid-compact - 3 columns
*/
$width : 65%
$min-width : 980px
@import susy
$total-columns: 49
$column-width: 20px
$gutter-width: 0px
$grid-padding: 0px

文學編程(咖啡版)

你想要用文學編程來寫程式嗎?我們先來做一個列出 1 至 10 的簡單程式吧!

結構

我們需要做一些宣告、接著以迴圈產出一個數字的陣列,最後才能列印出 1 至 10 的數字。

start = 1

end = 10

@josephj
josephj / 文學編程.md
Last active December 17, 2015 08:38
文學編程.md

文學編程

你想要用文學編程來寫程式嗎?我們先來做一個列出 1 至 10 的簡單程式吧!

將檔案儲存在 count.js

FILE "結構" count.js

結構

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Position</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
<style type="text/css">
@josephj
josephj / .jshintrc
Created April 16, 2013 07:26
miiiCasa 的 JSHint 設定,還需要再討論。
/**
* JSHint options: http://www.jshint.com/docs/#options
*/
{
"bitwise": true,
//"camelcase": true,
"curly": true, // Disallows curly.
"eqeqeq": true,
"forin": true,
"immed": true,
@josephj
josephj / focus-auto-scroll.php
Last active December 16, 2015 03:19
Focus Auto Scroll Effect for WebView. ( http://lab.josephj.com/2013/anim-focus-scroll/demo.php )
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="josephj">
<meta name="created" content="2013-04-10">
<title>Focus Auto Scroll</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.7.2/build/cssreset/reset-min.css">
<link rel="stylesheet" href="http://yui.yahooapis.com/3.7.2/build/cssfonts/fonts-min.css">
<script type="text/javascript" src="http://yui.yahooapis.com/3.7.2/build/yui/yui-min.js"></script>
@josephj
josephj / ajax-xdr.html
Created March 7, 2013 06:37
Cross-domain testing.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>XMLHttpRequest Cross Domain</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<style type="text/css">
</style>
</head>
<body>
@josephj
josephj / install-sublime2-package-control.py
Created March 4, 2013 00:07
Install Package Control for Sublime Text 2
import urllib2,os;
pf='Package Control.sublime-package';
ipp=sublime.installed_packages_path();
os.makedirs(ipp) if not os.path.exists(ipp) else None;
urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler()));
open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read());
print 'Please restart Sublime Text to finish installation'