Skip to content

Instantly share code, notes, and snippets.

Avatar

Chamnap Chhorn chamnap

View GitHub Profile
View gist:1086151
Ruby Gems
nokogiri
typhoeus
dalli
rails
sinatra
mongo_mapper
rabl
rake
@chamnap
chamnap / file1
Last active Dec 14, 2015
Mongoid collection name
View file1
require 'mongoid'
class A
end
class B
end
class Book
include Mongoid::Document
end
@chamnap
chamnap / content-popover.js
Created Mar 4, 2013
Twitter bootstrap popover without title and close popover when outside
View content-popover.js
# This plugin does two things:
# 1. make popover with no title, https://github.com/twitter/bootstrap/issues/1892
# 2. click elsewhere to close, http://jsfiddle.net/asanger/AFffL/266/
( ($) ->
$.fn.content_popover = (options) ->
$.each @, () ->
# Default set to false
isVisible = false
clickedAway = false
@chamnap
chamnap / loader.js.coffee
Created Mar 14, 2013
Manage javascript code in large rails app
View loader.js.coffee
NS.Loader =
exec: (controller, action="init") ->
ns = NS
controller = _.capitalize(_.singularize(controller))
ns[controller][action]() if controller? and ns[controller]? and ns[controller][action]?
return
init: () ->
## load underscore string
_.mixin(_.string.exports())