
Tuesday, December 30, 2008
Saturday, December 13, 2008
simple clone of GitHub Badge
Thanks to jQuery, I just spend three hours to create GitHub Widget, a clone of GitHub Badge. The widget is put in the sidebar of this page.

Compare with GitHub Badge, GitHub Widget is full written in jQuery, so that it is also compatible with IE. And the usage and html structure is full compatible with GitHub Badge.
I host it here temporarily. Please feel free to use it.

Compare with GitHub Badge, GitHub Widget is full written in jQuery, so that it is also compatible with IE. And the usage and html structure is full compatible with GitHub Badge.
I host it here temporarily. Please feel free to use it.
Labels:
github,
javascript,
jquery
github api callback
Not documented on Official GitHub API Guide, GitHub provide "callback" parameter to allow corss-site json accessing.
Example in jQuery:
Example in jQuery:
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js' type="text/javascript"></script>
<script>
function myFunction(data) {
// data is the json we would get
}
$.getScript("http://github.com/api/v1/json/username?callback=myFunction")
</script>
Labels:
api,
github,
javascript
Friday, December 5, 2008
OPT presentation
Slide which was uploaded to slideshare.net:
PDF of submitted paper:
http://sites.google.com/site/shelling/Home/archive/opt2008%5Brevisedrelease%5D.pdf?attredirects=0PDF version slide:
http://sites.google.com/site/shelling/Home/archive/opt-presentation.pdf?attredirects=0
Labels:
photonics,
presentation
Thursday, November 6, 2008
perl work with growl
Excerpt from
http://oreilly.com/catalog/9780596526740/toc.html
and
http://search.cpan.org/~cnandor/Mac-Growl-0.67/lib/Mac/Growl.pm
A quick method to post notification to Growl.
http://oreilly.com/catalog/9780596526740/toc.html
and
http://search.cpan.org/~cnandor/Mac-Growl-0.67/lib/Mac/Growl.pm
A quick method to post notification to Growl.
#!/usr/bin/env perl
use warnings;
use strict;
use Mac::Growl qw(:all);
Mac::Growl::RegisterNotifications(
# register your application in Growl before posting.
# just one time enough.
'growlalert', # app name
['alert'], # all notification
['alert'], # default notification
);
Mac::Growl::PostNotification(
# post notification to Growl
"growlalert", # app name
"alert", # notification type
"this is a title", # alert title
"this is a description", # alert content
);
Labels:
perl,
perl module,
programming
Monday, October 13, 2008
push in scheme
01 (define push
02 (lambda (element stack)
03 (append stack (cons element '()))))
04
05 (push 'd '(a b c)) ; => (a b c d)
Though putting element before stack is a little weird XD.
Labels:
programming,
scheme
Wednesday, September 17, 2008
tip in mpb
Defect mode always appears around the number of super lattice cells, so set num-bands automatically is a better way if we do not confirm how big the supper lattice.
e.g.
e.g.
(define-param supercell-x 5)
(define-param supercell-y 11)
(set! num-bands (+ 2 (* supercell-x supercell-y)))
Saturday, September 6, 2008
Wednesday, September 3, 2008
expand tab
emacs: (setq-default indent-tabs-mode nil)
vim: set expandtab
but I could not find the setting in textmate :~
vim: set expandtab
but I could not find the setting in textmate :~
Subscribe to:
Posts (Atom)