This file contains 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 | |
from django.http import HttpResponse | |
from django.utils import simplejson | |
def jsonize(original_func): | |
def decorated_func(*args, **kwargs): | |
if "callback" in args[0].GET: | |
ret = original_func(*args, **kwargs) |
This file contains 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
def leastPosY2(document): | |
ret = 10000 | |
for x in range(document.numObject): | |
obj = document.object[x] | |
MQSystem.println(obj.name) | |
a = [i.y for i in obj.vertex] | |
print str(a) | |
#for xx in range(obj.numVertex): |
This file contains 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 | |
#http://www.kotokoi.org/2010/02/26/%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%A7%E3%82%BC%E3%83%AD%E5%9F%8B%E3%82%81%E3%81%84%E3%82%8D%E3%81%84%E3%82%8D%E3%80%82/ | |
_count=0 | |
while read line; do | |
_count=`expr $_count + 1` | |
val=$_count | |
for (( i = 0; i < $((4 - ${#val})); i++ )) |
This file contains 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
javascript:(function(){var e=document.getElementsByTagName("a"),t=[],n;for(var r=0;r<e.length;r++)n=e[r].href,n.indexOf("jpg")>2&&t.push(n);alert(t.join("\n"))}).call(this); | |
This file contains 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 | |
kill -9 `ps aux | grep compiz | grep -v grep | awk -F" " '{ print $2 }'` | |
compiz & |
This file contains 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 | |
f = open('utf-8.html') | |
text = f.read() | |
f.close() | |
print text.decode('utf-8').encode('sjis') | |
#a = unicode(text, 'utf-8') |
This file contains 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
//Backbone.js, underscore.js, jQueryに依存 | |
//Backboneグローバルオブジェクトを名前空間とする | |
if (!window.Backbone) { | |
window.Backbone = function () { | |
"use strict"; | |
}; | |
} | |
(function (Backbone) { |
This file contains 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
(function ($) { | |
"use strict"; | |
// チェックボックスと、それを包むTDのクリックイベントを連動させるモジュール。 | |
var TdInputBind = window.Backbone.View.extend({ | |
initialize: function (options) { | |
var settings = _.extend({el: 'table'}, options || {}); | |
this.setElement(settings.el); | |
}, | |
events: { |
This file contains 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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes') | |
, user = require('./routes/user') | |
, http = require('http') | |
, path = require('path'); |
This file contains 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
(function (_) { | |
"use strict"; | |
// usage: $("select[name="year]").html($(_.year({current: 2029}))); | |
var TEMPLATE = '<% if(empty) { %><option></option><% }; _.each(years, function(year) { %><option value="<%= year.year %>"><%= year.year %>年</option> <% }); %>'; | |
var _TEMPLATE = '<% if(empty) { %><option></option><% }; _.each(years, function(year) { %><option value="<%= year.year %>" <%= year.select %>><%= year.year %>年</option> <% }); %>'; | |
_.mixin({ | |
year: function (options) { |
OlderNewer