Skip to content

Instantly share code, notes, and snippets.

@jonghwanhyeon
jonghwanhyeon / background.js
Last active December 15, 2015 03:39
Drag to open link in new tab
chrome.extension.onConnect.addListener(function (port) {
port.onMessage.addListener(openLink);
});
var openLink = (function () {
var openers = {
tab: function (information ) {
chrome.tabs.create({
url: information.url,
active: false
@jonghwanhyeon
jonghwanhyeon / DragSensor.js
Created March 22, 2013 04:49
pseudo-drag event
(function ($) {
/*
up
_________________________________
| \
| up \
|__________________ \ _ move _ move
| \ \ | \ | \
V down \ move \ V / threshold V / up
S_0 ------------> S_1 ------------> S_2 ------------> S_3 ------------> S_f
import serial
import time
class SimpliciTI:
SIZE_OF_PACKET_HEADER = 3
HW_NO_ERROR = 0x06
def __init__(self):
self.device = serial.Serial()
class List {
public Item removeFirst() throws ListException {
if (this.count() <= 0) throw new ListException("no more item");
Item item = /* remove the first item from the list */;
return item;
}
}
class Stack {
public class a {
public static void main(String args[]) {
System.out.println(String.format("%5d%5d%5d", 1, 2, 3));
System.out.println(String.format("%5d%5d%5d", 11, 22, 33));
}
}
var $log = $('<div />');
function HanyangRegistration(student_number, grade, interval) {
this.student_number=student_number;
this.grade = grade;
this.interval_second = interval
if (typeof interval === "undefinded")
this.interval_second = 10;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Interop.Word;
namespace Converter
{
@font-face {
font-family: "돋움";
src: local("Malgun Gothic");
}
@font-face {
font-family: "돋움체";
src: local("Malgun Gothic");
}
@font-face {
font-family: AppleGothic;
src: local("Apple SD Gothic Neo");
}
@font-face {
font-family: "돋움";
src: local("Apple SD Gothic Neo");
}
import sys
FILENAMES = {
'first': [ 'shuffled_review_with_tag_{0}'.format(i) for i in range(0, 8) ],
'second': [ 'shuffled_review_without_tag_{0}'.format(i) for i in range(0, 8) ],
}
NUMBER_OF_CATEGORIES = 8 + 1 # including neutral
def read_entry(input_file):