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 / gist:8802445
Last active Aug 29, 2015
Custom Twitter CSS
View gist:8802445
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("twitter.com") {
.is-preview img {
transition: 0.2s linear opacity;
}
.stream-item:not(.open) .is-preview,
.stream-item:not(.open) .multi-photo {
View gist:b85564b263d637d33ee2
var PENDING = 0,
FULFILLED = 1,
REJECTED = 2;
export var PromiseMixin = {
getInitialState: function() {
return {promiseState: PENDING};
},
componentWillMount: function() {
View gist:a5550bfbf9cecff2aa22
/** @jsx React.DOM */
import React from 'react';
var popupId = 0;
function addStyle(doc, cssCode) {
var styleElement = doc.createElement("style");
styleElement.type = "text/css";
var head = doc.getElementsByTagName("head")[0];
View gist:ce26fdf91c7855ebd07f
var NewStatus = React.createClass({
render: function() {
return <div className="new-status">
<h2>New monolog</h2>
<form action="" onSubmit={this.handleSubmit}>
<textarea ref="text" /><br />
<input type="submit" value="Post" />
</form>
</div>;
},
@dittos
dittos / gist:60e80da8e8d11b475c9f
Created Aug 12, 2014
Example Upstart Configuration
View gist:60e80da8e8d11b475c9f
start on runlevel [2345]
stop on runlevel [016]
respawn
setuid www-data
setgid www-data
env PORT=11000
chdir /home/ditto/animeta
exec env/bin/gunicorn animeta.wsgi --bind 127.0.0.1:$PORT --error-logfile -
View app.py
class Handler(BaseHandler):
@property
def db(self):
if not hasattr(self, '_db'):
self._db = Session(bind=self.app.engine)
return self._db
def teardown_request(self):
db = getattr(self, '_db', None)
if db:
@dittos
dittos / IconButton.rsx
Last active Aug 29, 2015
React Component Container Format
View IconButton.rsx
name: IconButton
props:
text:
required: true
type: string
description: A button text.
example: Click Me!
icon:
required: true
type: string
@dittos
dittos / c60.py
Last active Aug 29, 2015
@Code_60: Sorting
View c60.py
import sys
from wand.image import Image
from wand.color import Color
from wand.drawing import Drawing
with Image(filename=sys.argv[1]) as img:
pixels = []
for row in img:
for col in row:
pixels.append(col)
@dittos
dittos / Relay Internals.md
Last active Aug 29, 2015
Relay Internals
View Relay Internals.md
View Task Queue.md
  • 쓰레드가 N개인 쓰레드 풀이 있습니다.
  • 들어오는 태스크에는 Key가 있어서, Key가 같은 태스크끼리는 들어오는 순서대로 실행되어야 합니다.

예:

Pool Size = 4
You can’t perform that action at this time.