This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a = [ | |
| {'id': 1, 'ca': 123}, {'id': 2, 'ca': 321}, {'id': 3, 'ca': 213} | |
| ] | |
| Array.prototype.groupBy = (key, callback) -> | |
| res = {} | |
| if key is undefined | |
| throw "key cannot be undefined. you MUST define key function." | |
| for i in this | |
| do (i) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function () { | |
| $(".fixed_img_col li").each(function (h) { | |
| var i = $(this).find("a").attr("href"); | |
| var j = (width != 180) ? "C320x180" : "C120x90"; | |
| var k = (width == 180) ? "" : "mq"; | |
| if (h % col == 0) $(this).addClass("odd"); | |
| var d = $(this).find(".thumb img"); | |
| var f = $(this).find(".thumb #str"); | |
| $.ajax({ | |
| url: i, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* make HTML Form RESTful!! | |
| Usage | |
| ====== | |
| .. | |
| <form action="/user/" method="PUT" id="userForm"> | |
| <input type="text" name="id" /> | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Timer(object): | |
| def __init__(self): | |
| self.start = None | |
| self.l = [] | |
| def mark(self, name=''): | |
| from time import time | |
| if name: | |
| print name + ' marked.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import sys;print u"%s \nA: 그만하자.\nB:응." % "\n".join(map(lambda x: u"%s %s 내 맘도 몰라주는 바보!" % (("A:" if x%2==0 else "B:"), u"".join(map(lambda y: u"%s 을 모르는 " % (u"내" if y%2==0 else u"네"), xrange(x, 2*x)))), xrange(0, int(sys.argv[1])))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @restful.get | |
| @app.route('/abc/') | |
| def abc(): | |
| pass | |
| @abc.put | |
| def edit_abc(): | |
| pass | |
| @abc.delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import wraps | |
| class R(object): | |
| def __init__(self, a): | |
| self.a = a | |
| def post(self, f): | |
| setattr(self.a, 'blah', 'blah') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # colors.sh - Print out all the different ECMA color-mod combos | |
| # | |
| # 2008 - Mike Golvach - eggi@comcast.net | |
| # | |
| # Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License | |
| # | |
| declare -a color_array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # from http://www.commandlinefu.com/commands/view/6533/print-all-256-colors-for-testing-term-or-for-a-quick-reference | |
| ( x=`tput op` y=`printf %$((${COLUMNS}-6))s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done; ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html | |
| ><head> | |
| </head><body | |
| ><p class="nnn" | |
| id="d"></p></body> | |
| <script type="text/javascript"> | |
| a=Math.floor;b=Math.random;c=function(){ | |
| return a(b()*3);};d=['*','+','-', '='];n=' '; | |
| i=0;g='';l=10;while(true){y=0;m=l-i;for(p=0;p<m;p++){g+=n;} | |
| while(true){y+=1;g+=d[c()];if(y==i*2+1){break;}}i+=1;g+='<br/>'; |