Skip to content

Instantly share code, notes, and snippets.

@lumin3000
lumin3000 / .emacs
Created December 8, 2010 14:58
sjerrys's mini .emacs
;;配置路径
(add-to-list 'load-path "~/.emacs.d")
;;字体
(custom-set-faces
;; ;; custom-set-faces was added by Custom.
;; ;; If you edit it by hand, you could mess it up, so be careful.
;; ;; Your init file should contain only one such instance.
;; ;; If there is more than one, they won't work right.
@lumin3000
lumin3000 / ModulePattern.coffee
Created December 18, 2010 10:16
module pattern in CoffeeScript
jclass = ()->
max = 1
res = (x)->alert 2
result=
alert:(x)->alert 1
ds:(x,y)->
alert(y+max)
instance = jclass null
instance.ds 18
@lumin3000
lumin3000 / jtest.coffee
Created January 4, 2011 09:45
a test file
class Animal
constructor: (@name,@array) ->
sit = [1..100]
move: (meters) ->
ab=[]
sit.each (el,idx)->
ab[idx]=++el
alert ab
#alert @name + " moved" + meters + "m."
@lumin3000
lumin3000 / boutofcontext_image1280.js
Created October 22, 2011 14:28
transform the 500px images to 1280 images in boutofcontext.com (for tumblr backup)
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = ' https://ajax.googleapis.com/ajax/libs/mootools/1.4.1/mootools-yui-compressed.js';
document.getElementsByTagName("body")[0].appendChild(newScript);
//###make a bookmarklet using the code before this line###
var post = $$('div#post');
var posturl,
postid,
imageid,
image1280url,
@lumin3000
lumin3000 / .vimrc
Created January 13, 2012 14:18
sunchen's mini vim
hi NonText ctermfg=black guifg=black
set sw=2 sts=2 et
set ai nocp digraph ek hid ru sc vb wmnu noeb noet nosol
set bs=2 fo=cqrt ls=2 shm=at tw=72 ww=<,>,h,l
set comments=b:#,:%,n:>
set list listchars=tab:»·,trail:·
set viminfo=%,'50,\"100,:100,n~/.viminfo
@lumin3000
lumin3000 / init.el
Created January 28, 2012 04:48
my init.el for osx emacs 2011
;;Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars.
;;It is not just bigger and brighter; it simply makes everything else vanish.
;; -Neal Stephenson, "In the Beginning was the Command Line"
;;配置路径
(add-to-list 'load-path "~/.emacs.d")
;;显示相关设置
DOINGFILE="..../nvalt/whatiamdoing.md"
if [[ $# -eq 0 ]]; then
awk '{\
if (currently==1)
if (match($0,/^[^\t]/))
currently=0
else {
if ($0 !~ /@done/) {
sub(/^[ \t]+/,"")
@lumin3000
lumin3000 / watcher.coffee
Created February 9, 2012 04:02
markdown wathcer
###
Purpose:
Print web preview in lynx when the markdown file edited.
System requirement:
brew install markdown
brew install lynx
Usage:
@lumin3000
lumin3000 / meta-tags.md
Created March 6, 2012 00:11 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@lumin3000
lumin3000 / gist:2490794
Created April 25, 2012 15:48 — forked from reidransom/gist:2341103
Use nowjs with node-static server
var fs = require('fs');
var node_static = require('node-static');
var file = new(node_static.Server)('./public');
var server = require('http').createServer(function(request, response){
request.addListener('end', function() {
file.serve(request, response);
});
});
server.listen(8080);