Skip to content

Instantly share code, notes, and snippets.

View dittos's full-sized avatar
💥
뿌슝빠슝

Taeho Kim dittos

💥
뿌슝빠슝
View GitHub Profile
@dittos
dittos / trac-tickets-to-gh.py
Created July 29, 2010 07:53
Trac tickets to GitHub issues
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'
<?php
require_once 'Ponytail/Model.php';
require_once 'Ponytail/Shortcuts.php';
$urls = array(
'^$' => 'index.php#index',
'^(?P<id>[0-9]+)$' => 'article_detail',
);
$config = array();
# encoding: utf-8
"""
TODO
----
* boolean, 조건문
* typing
* 음수, 소수, 분수
* 단어 정의할 때 덮어쓰기?
"""
@dittos
dittos / array.c
Created October 23, 2011 17:13
Compiler HW
/* 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 February 28, 2012 15:57
세발낚지 최전방 봇
import gevent.monkey; gevent.monkey.patch_all()
import os
import time
import datetime
import socket
import logging
import gevent
import redis
#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 15:19
jsaheui on 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("ㄱ", "ㄲ", "ㄴ", "ㄷ", "ㄸ", "ㄹ", "ㅁ", "ㅂ", "ㅃ", "ㅅ", "ㅆ", "ㅇ", "ㅈ", "ㅉ", "ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ");

bf2aheui

명령어 번역

테이프

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

<-- v -->

파이썬 웹개발 요리책

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

파이썬 복습

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

  • 모듈
@dittos
dittos / replace.py
Created December 4, 2012 11:08 — forked from jjangdm/replace.py
please
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)