This file contains hidden or 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
class DeepHash < Hash | |
def initialize | |
self.default_proc = Proc.new {|hash, key| hash[key] = DeepHash.new} | |
end | |
end |
This file contains hidden or 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
if exists('g:loaded_toggle_foldlevel') | |
finish | |
endif | |
let s:original_cpoptions = &cpoptions | |
set cpoptions&vim | |
function! s:toggle_foldlevel() | |
if !exists('s:folded') | |
let s:folded = 0 |
This file contains hidden or 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/ruby19 | |
require 'sequel' | |
Sequel::Model.plugin :schema | |
DB = Sequel.sqlite | |
class Post < Sequel::Model | |
set_schema do |
This file contains hidden or 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/ruby19 | |
require 'sequel' | |
Sequel::Model.plugin :schema | |
DB = Sequel.sqlite | |
class Post < Sequel::Model | |
set_schema do |
This file contains hidden or 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/ruby19 | |
# coding: utf-8 | |
require 'mechanize' | |
hiragana_characters = %w( | |
あ い う え お | |
か き く け こ | |
さ し す せ そ | |
た ち つ て と |
This file contains hidden or 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
# ref: http://code.google.com/intl/ja/appengine/docs/python/datastore/entitiesandmodels.html | |
# ----- | |
# Model | |
# ref: http://code.google.com/intl/ja/appengine/docs/python/datastore/modelclass.html | |
# ----- | |
from google.appengine.ext import db | |
class Pet(db.Model): |
This file contains hidden or 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
# ref: http://code.google.com/intl/ja/appengine/docs/python/datastore/entitiesandmodels.html#Properties_and_Types | |
# reserved attribute names by the Model class | |
# | |
# all, app, copy, delete, entity, entity_type | |
# fields, from_entity, get, gql, instance_properties | |
# is_saved, key, key_name, kind, parent, parent_key | |
# properties, put, setdefault, to_xml, update | |
# -------------- |
This file contains hidden or 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
class Storage | |
constructor: -> | |
@init() | |
init: -> | |
@table = {} | |
@keys = [] | |
@length = 0 | |
clear: -> |
This file contains hidden or 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
require 'serialport' | |
port = "/dev/ttyAMA0" | |
bps = 115200 | |
class ESP8266 | |
def initialize(port, bps) | |
@serial_port = SerialPort.new(port, bps) | |
end |
This file contains hidden or 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
peripheral discovered (xxxxxxxxxxxx with address <xx:xx:xx:xx:xx:xx, public>, connectable true, RSSI -68: | |
hello my local name is: | |
ButtonLE | |
can I interest you in any of the following advertised services: | |
["19b10010e8f2537e4f6cd104768a1214"] |
OlderNewer