Skip to content

Instantly share code, notes, and snippets.

😂
I enjoy

Taeho Kim dittos

😂
I enjoy
Block or report user

Report or block dittos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dittos
dittos / trac-tickets-to-gh.py
Created Jul 29, 2010
Trac tickets to GitHub issues
View trac-tickets-to-gh.py
import sys; reload(sys); sys.setdefaultencoding('utf-8')
import sqlite3
import urllib2
import urllib
import simplejson
login = 'your github id'
token = 'your github api key'
repo = 'username/reponame'
View ponytail-example.php
<?php
require_once 'Ponytail/Model.php';
require_once 'Ponytail/Shortcuts.php';
$urls = array(
'^$' => 'index.php#index',
'^(?P<id>[0-9]+)$' => 'article_detail',
);
$config = array();
View gist:545110
# encoding: utf-8
"""
TODO
----
* boolean, 조건문
* typing
* 음수, 소수, 분수
* 단어 정의할 때 덮어쓰기?
"""
View array.c
/* array.c -- Operations on arrays
*/
#include <stdio.h>
int main(void) {
int a[2] = {1,2}; /* The aggregates like {1,2} are literals for arrays */
int b[2] = {2,3};
int i;
@dittos
dittos / gist:1933315
Created Feb 28, 2012
세발낚지 최전방 봇
View gist:1933315
import gevent.monkey; gevent.monkey.patch_all()
import os
import time
import datetime
import socket
import logging
import gevent
import redis
View gist:2686869
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SPACE_WIDTH 100
#define SPACE_HEIGHT 100
#define STACK_CAPACITY 100
int space[SPACE_HEIGHT][SPACE_WIDTH];
int width, height;
@dittos
dittos / jsaheui-node.js
Created May 13, 2012
jsaheui on node.js
View jsaheui-node.js
// BEGIN PATCH
dump = console.dir;
msg_coordinate = "Coord: ";
msg_character = "Char: ";
msg_input_number = "Type a number. Type !!! to pause the execution.";
msg_input_character = "Type a character or more. Type !!! to pause the execution.";
// END PATCH
//상수, constants
cheossori = new Array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
View gist:3274591

bf2aheui

명령어 번역

테이프

ㄱ, ㄴ 두 개의 스택을 사용하여 테이프를 구현한다.

<--    v    -->
View gist:3737902

파이썬 웹개발 요리책

바로 실전에 적용할 수 있는 파이썬 웹 개발 레시피. 기초적인 파이썬 지식이 필요합니다.

파이썬 복습

앞으로 다룰 내용에서 알아둬야 할 파이썬 기능을 다시 한번 짚고 넘어갑니다. 이미 파이썬 고수라면 건너뛰셔도 좋습니다!

  • 모듈
View replace.py
def report(request):
today = datetime.datetime.now()
executor = Executor.objects.all()
queryset = Budget.objects.filter(year=today.year)
aggregates = {}
for i in xrange(1, 25+1):
aggregates['out%d' % i] = models.Sum('out%d' % i)
budget = queryset.aggregate(**aggregates)
You can’t perform that action at this time.