Skip to content

Instantly share code, notes, and snippets.

Title: 펄의 구문은 분석될 수 없다: 형식적인 증명 Package: Seoul.pm Category: perl Category: Seoul.pm Author: Jeffrey Kegler

저자

@am0c
am0c / posa.mkdn
Created November 1, 2012 15:15 — forked from audreyt/posa.mkdn
EtherCalc Chapter for POSA

From SocialCalc to EtherCalc

Previously, in The Architecture of Open Source Applications, I described SocialCalc, an in-browser spreadsheet system that replaced the server-centric WikiCalc architecture. SocialCalc performs all of its computations in the browser; it uses the server only for loading and saving spreadsheets.

...diagram on SocialCalc's scalability model...

For the Socialtext team, performance was the primary goal behind SocialCalc's design. The key observation was this: Client-side computation in JavaScript, while an order of magnitude slower than server-side computation in Perl, was much faster than the network latency incurred during AJAX roundtrips.

Toward the end of the AOSA chapter, we introduced simultaneous collaboration on spreadsheets, using a simple, chatroom-like architecture:

@am0c
am0c / gist:3992960
Created November 1, 2012 10:28
copy-region-as-fill in Emacs 24
;; copy region as `fill-region`ed even
;; in longlines-mode or visual-line-mode.
;;
;; thanks to @y0ngbin for this idea.
(global-set-key [?\C-x ?\M-w] 'copy-region-as-fill)
(defun copy-region-as-fill (beg end)
(interactive "r")
(when (region-active-p)
@am0c
am0c / gist:3979793
Created October 30, 2012 11:59 — forked from aanoaa/gist:3979758
bugzilla-install.sh
#!/bin/sh
BZ_ADMIN_EMAIL='<user>@gmail.com'
BZ_ADMIN_PASSWORD='****'
BZ_ADMIN_REALNAME='realname'
BZ_SERVER_NAME='bz4.localhost'
BZ_URLBASE='http://bz4.localhost/'
BZ_APACHE_GROUP='www-data'
BZ_INSTALL_PATH='/home/bugzilla/public_html/bugzilla'
@am0c
am0c / gist:3916541
Created October 19, 2012 06:30
Perl6 bug or not?
am0c@amolap:~/local/pt$ cat MainWindow.pm
use Listener;
class MainWindow {
has Listener $.listener;
}
am0c@amolap:~/local/pt$ cat Listener.pm
use MainWindow;
@am0c
am0c / Hubot::Listener.pm
Created October 19, 2012 05:05
Hubot::Listener.pm6
use v6;
class Hubot::Listener {
has Code $.match is rw;
has Code $.callback is rw; # handles cb => postcircum:<( )>
# .. does not work
method call ($message --> Bool) {
my @matching = $.match.($message);
$ traceroute 64.111.29.139
traceroute to 64.111.29.139 (64.111.29.139), 30 hops max, 60 byte packets
1 192.168.219.1 (192.168.219.1) 29.574 ms 40.702 ms 52.115 ms
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
8 * * *
@am0c
am0c / gist:3803249
Created September 29, 2012 05:16
emacs config for Mojolicious::Lite file
;
; mmm-mode config for Mojolicious::Lite perl file.
; mmm-mode lib is from here: https://github.com/purcell/mmm-mode
; font locks of [c]perl-mode and mmm-mode conflict each other.
;
(add-to-list 'load-path "~/.emacs.d/packages/mmm-mode")
(require 'mmm-auto)
(require 'mmm-compat)
(require 'mmm-vars)
@am0c
am0c / gist:2893528
Created June 8, 2012 04:13
VNC 터널링
# VNC 서버 머신에 vnc-tunnel.sh과 vnc-setup.sh 파일을 넣고 vnc-setup.sh을 실행한다.
# 클라이언트에서 vnc-viewer.sh을 실행한다.
#
# +----------+ ssh +-----------+ ssh +----------+
# | Server |---->| Gateway |<----| Client |
# +----------+ +-----------+ +----------+
# ? vnc.gateway.am0c.org ?
#
#------------ vnc-setup.sh ------------#
#!/bin/sh
am0c@amolap:~/tmp/stat$ cat section-3.R
resist <- data.frame(
case = c(
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1