This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var schedule_dialog = $("#appt-dialog") | |
schedule_dialog.dialog({ | |
autoOpen: false, | |
modal: true, | |
minWidth: 600, | |
minHeight: 200 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Change SEARCH_ROOT to point to proper directory. | |
# USAGE: ruby grepword.rb <word> | |
SEARCH_ROOT = "/path/to/books/directory" | |
word = Regexp.new(ARGV[0].encode('utf-8', 'external')) | |
def clean line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
/* | |
Example Usage: | |
char * str = getString(); | |
double val; | |
if (tryParseDouble(str, &val)) { | |
doSomethingWith(val); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
import subprocess | |
import re | |
import os | |
import tempfile | |
# RUBY_METHOD_SEP_PATTERN = re.compile('[^.:]*$') | |
RUBY_METHOD_SEP_PATTERN = re.compile('((?<=\.).*$)|((?<=::).*$)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdbool.h> | |
typedef unsigned char uchar8_t; | |
static bool is_leading_byte(const uchar8_t c) | |
{ | |
return (c <= 0x7f || c >= 0xc2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
FULL_KATA_OFFSET = ord(u"ァ") - ord(u"ぁ") | |
half_kata_to_hira = u"をぁぃぅぇぉゃゅょっーあいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよ" | |
def normalize_kana(s): | |
"""Normalizes all kana in the given string to full-width hiragana. | |
Args: | |
s String to be normalized. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 4241 4-bit Microprocessor | |
// | |
// Registers: r0 r1 | |
// | |
// 1-byte Instructions | |
// 0 = Halt | |
// 1 = Add (r0 = r0 + r1) | |
// 2 = Subtract (r0 = r0 - r1) | |
// 3 = Increment r0 | |
// 4 = Increment r1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_entry_type(self): | |
"""Returns selected entry type as string key.""" | |
radio_pairs = [(self.window.ui.book_radio, 'book'), | |
(self.window.ui.manga_radio, 'manga'), | |
(self.window.ui.game_radio, 'game'), | |
(self.window.ui.flgame_radio, 'fullgame'), | |
(self.window.ui.net_radio, 'net'), | |
(self.window.ui.news_radio, 'news'), | |
(self.window.ui.nico_radio, 'nico'), | |
(self.window.ui.subs_radio, 'subs'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import ast | |
RE_EXPR = re.compile(ur"\((\d+\.?\d*\s?[+-]\s?\d+\.?\d*)\)") | |
RE_TIME = re.compile(ur"(\d{2}):(\d{2}):(\d{2})") | |
def parse_value(string, entry_type): | |
"""Parses an input value to floating point. Allows expressions | |
of the form `(XX.X[+-]XX.X)` or `XX:XX:XX` as special cases, otherwise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def contains(self, value): | |
""" contains | |
Searchs recursively for a node containing the given value from current | |
node. Returns True on success and False on failure. | |
Args: | |
value: the value being searched for in the tree. | |
""" | |
def _contains(value, current): |