Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| html, body, .container, .content { | |
| height: 100%; | |
| } | |
| .container, .content { | |
| position: relative; | |
| } | |
| .proper-content { | |
| padding-top: 40px; /* >= navbar height */ |
| defmodule Hygiene do | |
| defmacro interference do | |
| quote do: var!(a) + var!(b) + var!(c) | |
| end | |
| end | |
| defmodule HygieneTest do | |
| def go do | |
| require Hygiene | |
| a = 10 |
Original transcript: http://allisonrandal.com/2012/04/15/open-source-enlightenment/
這幾年來,我慢慢覺得,我們參與開源社群,就像是在一條道路上並肩而行:這不僅讓我們成為更好的程式設計者,也讓我們通過與人合作,而成為更好的人。
您可以將它想成一條修行之道,讓身而為人的我們能夠不斷成長。接下來,我想談談我對開源世界的個人觀點,希望能與您分享。
首先,人是一切開源專案的核心。程式碼是很重要,但最核心的永遠是人。
| # Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
| # that enables you to choose a character from a menu of options. If you are on Lion | |
| # try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
| # for input. | |
| # | |
| # It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
| # it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
| # as it means you cannot press and hold h/j/k/l to move through your file. You have | |
| # to repeatedly press the keys to navigate. |
| defmodule Chat.Client do | |
| # In all of the following functions 'server' stands for the server's pid | |
| def join(server) do | |
| send server, :join | |
| end | |
| def say(server, message) do | |
| send server, { :say, message } | |
| end | |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
| # install and make run basic bootstrap date-picker functionality described here http://www.eyecon.ro/bootstrap-datepicker/ | |
| # app/assets/javascript/datepicker.js.coffee | |
| $(document).on 'pageChanged', -> | |
| # datepicker for simple_form & Ransack | |
| $(".custom_datepicker_selector").datepicker().on 'changeDate', (en) -> | |
| correct_format = en.date.getFullYear() + '-' + ('0' + (en.date.getMonth() + 1)).slice(-2) + '-' + ('0' + en.date.getDate()).slice(-2) # date format yyyy-mm-dd | |
| $(this).parent().find("input[type=hidden]").val(correct_format) |
| #!/bin/bash | |
| # | |
| # PostgreSQL Backup Script Ver 1.0 | |
| # http://autopgsqlbackup.frozenpc.net | |
| # Copyright (c) 2005 Aaron Axelsen <[email protected]> | |
| # | |
| # This script is based of the AutoMySQLBackup Script Ver 2.2 | |
| # It can be found at http://sourceforge.net/projects/automysqlbackup/ | |
| # | |
| # The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9 |