Skip to content

Instantly share code, notes, and snippets.

View naoyamakino's full-sized avatar

Naoya Makino naoyamakino

View GitHub Profile
@naoyamakino
naoyamakino / gist:5504109
Created May 2, 2013 18:10
Datomic, from Ruby, from Rails via @yokolet #railsConf
Diametric gem https://github.com/relevance/diametric
- ActiveModel wrapper of Datomic. MRI via REST service. Jruby via REST service
Datomic is via Rich Hickey, newSql database.
ACID (atomicity, consistency, Isolation, Durability) guranteed.
- has idea of simplicity
- datomics schema, - Array of Hash
- data: array of hash
- query - array in array
- data is immutable
@naoyamakino
naoyamakino / railsConfExractableLib.md
Last active December 16, 2015 21:20
Building Extractable Libraries in Rails via Patrick Robertson #railsConf

Building Extractable Libraries in Rails

Avoiding the autoload trap

  • rails 3: removing /lib from automatically being loaded on application boot

create a namespace and setup a proper layout when we need to extract our code outside the application into a gem

Hide your credentials from your Library

#config/initializers/twitter_wrangler.rb
@naoyamakino
naoyamakino / railsConfElasticSearchNote.md
Last active December 16, 2015 21:09
Using elastic search with rails app via Brian Gugliemetti #railsConf

Using elastic search with rails app via Brian Gugliemetti

http://www.elasticsearch.org/

elastic search

  • RESTful search engine built on top of Apache

wanted: autocomplete, replace database full-text search, bring site earch in-house

Terms

node: instance of elasticsearch which belongs to a cluster

@naoyamakino
naoyamakino / railsConfNote_documentationTips.md
Last active December 16, 2015 20:29
How to Write Documentation for People That Don't Read Kevin Burke #railsConf
@naoyamakino
naoyamakino / REPL
Created November 9, 2012 00:01
using NanoStore::Model to do basic relations.
(main)> bag = NanoStore::Bag.bag
=> #<NanoStore::Bag:0x8c930b0>
(main)> NanoStore.shared_store.addObject(bag, error:nil)
=> true
(main)> bag.setName "cars"
=> #<NanoStore::Bag:0x8c930b0>
(main)> user = User.create(8, 'demo', 23, bag.name)
=> #<User:0x8c93800>
(main)> user.save
=> #<User:0x8c93800>
@naoyamakino
naoyamakino / ViewController.m
Created October 25, 2012 22:28
ViewController.m from CoreData tutorial http://www.youtube.com/watch?v=mEAav7dM4hk
//
// ViewController.m
// coreDataTutorial
//
// Created by Naoya Makino on 12-10-25.
// Copyright (c) 2012 Naoya Makino. All rights reserved.
//
#import "ViewController.h"
#import "AppDelegate.h"
@naoyamakino
naoyamakino / .vimrc
Created October 21, 2012 20:48
vimrc
set enc=utf-8
set nu
function! WindowsizeMaximize13()
set lines=570
set columns=1810
colorscheme ir_black
endfunction
"command! WindowsizeMaximize13 call WindowsizeMaximize13()
filetype indent plugin on
@naoyamakino
naoyamakino / a.py
Created September 1, 2011 00:23 — forked from ujihisa/a.py
# a = 1
# b = a + 2
# print b
program = [
('assign', 'a', ('value', 1)),
('assign', 'b', ('plus', ('refer', 'a'), ('value', 2))),
('print', ('refer', 'b')),
('variables',)]
variables = {}
@naoyamakino
naoyamakino / parser.py
Created February 23, 2011 07:29 — forked from aaronpk/parser.py
iCal feed parser for HearNear.org
from icalendar import Calendar, Event
import simplejson as json
import re
import web
from mimerender import mimerender
import sys
import urllib2
event = {}
@naoyamakino
naoyamakino / parser.py
Created February 22, 2011 01:04
iCal feed parser for HearNear.org
from icalendar import Calendar, Event
import simplejson as json
import re
import web
from mimerender import mimerender
import sys
event = {}
urls = (
'https://api.geoloqi.com/1/place/create', 'place'