Skip to content

Instantly share code, notes, and snippets.

View shoveller's full-sized avatar

cinos shoveller

  • SEOUL, SouthKorea
  • 15:40 (UTC +09:00)
View GitHub Profile
# -*- coding: utf-8 -*-
"""
This script will delete all of the tweets in the specified account.
You may need to hit the "more" button on the bottom of your twitter profile
page every now and then as the script runs, this is due to a bug in twitter.
You will need to get a consumer key and consumer secret token to use this
script, you can do so by registering a twitter application at https://dev.twitter.com/apps
@requirements: Python 2.5+, Tweepy (http://pypi.python.org/pypi/tweepy/1.7.1)
@shoveller
shoveller / ClockThread.py
Last active August 29, 2015 14:02
Thread in python 2.7. 파이썬2.7에서 쓰레드 구현하기
# -*- coding: UTF-8 -*-
__author__ = 'cinos81'
import threading
import time
#함수를 쓰레드로 만들 때의 공유자원을 가정한 변수
globalResource = 0
@shoveller
shoveller / qryStrParser.js
Created June 24, 2014 00:38
쿼리스트링 parser
/**
* Created by cinos81 on 2014. 6. 24..
*/
var paramFromQryStr = function(url){
/*
* 첫번째 정규식
* . : 모든 글자로부터
* + : 1개 이상의 글자를
* ? : ? 를 만날 때까지
@shoveller
shoveller / dictionaryComprehension
Created July 14, 2014 09:51
select절을 사용하듯 딕셔너리 리스트에서 특정 키값으로 가리킬 수 있는 컬럼만 추출하려면?
__author__ = 'cinos81'
if __name__ == '__main__':
testList = [{'a': 1, 'b': 2}, {'a': 'a', 'b': 'b'}]
print testList
subsetList = [{key: value for key,value in record.items() if key == 'a'} for record in testList]
print subsetList
@shoveller
shoveller / gist:08b4465ce637e61c8075
Created September 20, 2014 08:03
클래스 스스로 자신의 속한 위치를 알아내려면
//클래스명을 통해 접근 가능.
ClassName.class.getResource("").getPath();
//클래스 인스턴스 내에서 다음처럼 접근하는 것 또한 가능
this.getClass().getResource("").getPath();
@shoveller
shoveller / server.js
Created October 4, 2014 15:57
express.js 를 사용한 가장 간단한 서버
/**
* Created by cinos81 on 2014. 10. 4..
*/
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.sendfile('index.html');
});
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="jquery-ui-1.11.1.custom/external/jquery/jquery.js"></script>
<script src="jquery-ui-1.11.1.custom/jquery-ui.js"></script>
<script>
/*
@shoveller
shoveller / reset.txt
Created December 23, 2014 04:39
폼을 초기 로딩상태로 회복시키려면
폼을 초기 로딩상태로 회복시키는 방법은 2가지 방법이 있음.
1. 자바스크립트로 programatic하게 form 자체의 dom메소드를 활용하는 방법
$('#reset')[0].reset();
2. DOM에 선언 reset type의 input 태그를 선언하는 방법
<input id="reset" type="reset" value="리셋" />
@shoveller
shoveller / paginated_collection.js
Last active August 29, 2015 14:26 — forked from io41/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@shoveller
shoveller / setCustomFooter_onPowerPoint.bas
Created September 23, 2012 07:48
파워포인트VBA_스닙펫:파워포인트 슬라이드마다 커스터마이즈된 푸터를 삽입
'작성일 : 2012.09.11
'작성자 : 서재원
'설명 : 파워포인트용 VBA모듈
' 파워포인트 슬라이드마다 커스터마이즈된 푸터를 삽입한다.
Sub setCustomFooter()