Skip to content

Instantly share code, notes, and snippets.

View chikamichi's full-sized avatar
🙈
You good?

Jean-Denis Vauguet chikamichi

🙈
You good?
View GitHub Profile
@chikamichi
chikamichi / apotomo-12mn.md
Created April 17, 2010 15:02
revamped, cleaned-up version of the 12 minutes tutorials serie

Remarks on apotomo 12mn tutorials

Meet the StatefulWidget! (Part 1)

1.

git clone git://github.com/apotonick/dumdidoo.git
cd dumdidoo/
git submodule init

git submodule update

@chikamichi
chikamichi / Notes-on-Cassandra.md
Created April 17, 2010 22:49
Notes on using Cassandra latest release with the Ruby binding
module Bar
def do_sth
puts "@proxy: #{@proxy.inspect}"
end
end
class Foo
include Bar
def initialize
@chikamichi
chikamichi / apotomo_example.rb
Created February 24, 2011 14:09
an example of Apotomo structure
class MyController < ApplicationController
include Apotomo::Rails::ControllerMethods
has_widgets do |root|
if must_attach_a_wigdet?
# current_widget_data is anything that the Cell needs to build
# the widget (say, a User record…)
root << widget('my_widget',
"widget_#{@current_widget_data.id}",
@chikamichi
chikamichi / apotomo_builders.rb
Created March 19, 2011 19:31
Apotomo support for builders
# in lib/apotomo/widget.rb
# This comes redundant with Cells internals, but this is due to what may be a flaw in current Apotomo's design,
# which bypass Cells workflow (render_cell_for) and hook directly into AbstractController::Rendering #render_state
# Renders the +widget+ (instance or id).
def render_widget(widget_id, state=:display, *args)
if widget_id.kind_of?(Widget)
widget = widget_id
else
widget = find_widget(widget_id) or raise "Couldn't render non-existent widget `#{widget_id}`"
@chikamichi
chikamichi / custom_specs.rake
Created October 12, 2011 11:03
How to add customs rspec tasks in Rails 3
# Our goal is to be able to run spec:bricks along spec, when
# using the 'rake spec' command.
# In lib/tasks/custom_specs.rake, add:
require 'rake/testtask'
require 'rspec/core/rake_task'
namespace :spec do
desc "Run bricks specs"
RSpec::Core::RakeTask.new('bricks') do |spec|
@chikamichi
chikamichi / data.csv
Created June 29, 2012 12:36
d3: radial stack with nest
key axis value
min 1 2
avg 1 3.6
max 1 5
min 2 3
avg 2 8.2
max 2 10
min 3 0
avg 3 2.6
max 3 8
@chikamichi
chikamichi / gist:5417680
Last active December 16, 2015 10:08
A fully-fledged CoffeeScript boilderplate for authoring jQuery plugin. It abides by the guidelines found at http://docs.jquery.com/Plugins/Authoring#Namespacing
###
FooBar jQuery Plugin v1.0 - It makes Foo as easy as coding Bar (?).
Release: 19/04/2013
Author: Joe Average <joe@average.me>
http://github.com/joeaverage/foobar
Licensed under the WTFPL license: http://www.wtfpl.net/txt/copying/
###
(($, window, document) ->
@chikamichi
chikamichi / links.md
Last active November 6, 2015 15:42
The web basics one must actually *know* about.
@chikamichi
chikamichi / 01-using-a-node-and-a-list.elm
Created January 14, 2016 03:59
Elm - reworking the FIFO implementation from
import Graphics.Element exposing (..)
import Text
type Fifo a
= Empty | Node a (List a)
empty : Fifo a
empty =
Empty