Skip to content

Instantly share code, notes, and snippets.

View jackdempsey's full-sized avatar

jack dempsey jackdempsey

View GitHub Profile
~/testbed/dm_test $ rake dm:db:database_yaml
(in /Users/jdempsey/testbed/dm_test)
/Users/jdempsey/testbed/dm_test/config/init.rb:1: warning: already initialized constant KCODE
~ Loaded DEVELOPMENT Environment...
~ loading gem 'merb_datamapper' ...
~ loading gem 'dm-core' ...
~ loading gem 'merb_datamapper' ...
~ Merb::Orms::DataMapper::Connect block.
~ No database.yml file found in /Users/jdempsey/testbed/dm_test/config, assuming database connection(s) established in the environment file in /Users/jdempsey/testbed/dm_test/config/environments
~ Checking if we need to use DataMapper sessions
Thanks Xavier, I too am a big fan of the style. It’s an honest capturing of what it’s like to learn this sort of thing for the first time (or in my case with fibers, the 10th).
Everything was clear up til the end, which is where the details get fuzzy for me.
If I could add in my $.02 to this final chunk:
class Surprise < Goliath::API
def response(env)
f = Fiber.current
EventMachine.add_timer 1, proc { f.resume }
Today, I’d like to put kids in the richest possible environment and let them choose.
It would not be school, with formal classes, summer breaks, and so on.
It would be a safe place that is open all the time.
A place where one might, or might not, encounter people reading aloud in one hall or organizing a puppet show,
with home-made puppets or building a saltwater aquarium with bacterial filters. It would have zoomable
binocular microscopes by the doors to the play areas, so that found leaves and rocks could be examined closely.
I’d want kids to take breaks whenever they feel like it, to play outside or sit with a book in a corner —
even if they kept that up for a year or more. They know who they are and what they need better than we ever will.
@jackdempsey
jackdempsey / gogo
Last active September 30, 2017 18:52
A template for a "go" script that you run in the morning to refresh code, open important webpages and reminders
~ > cat ~/bin/gogo
#!/bin/bash
echo "Good morning Jack!"
echo "******************"
cd ~/MAIN_REPO_HERE
echo "Checking out master..."
git checkout master
echo "Pulling changes..."
reup # my version of this https://gist.github.com/righi/0ca1b7d1bfa3fee03999
scala> Json.toJson((1, 2))
<console>:20: error: No Json deserializer found for type (Int, Int). Try to implement an implicit Writes or Format for this type.
Json.toJson((1, 2))
^
scala> implicit val x = new Writes[(Int, Int)] {
| def writes(t: (Int, Int)): JsValue = {
| JsArray(Seq(JsNumber(t._1), JsNumber(t._2)))
| }
| }
Hi Jack,
Ever watch someone’s head explode because they get so excited about what they are doing? Every manager and candidate I talk to
says they want PASSION in the people they hire, the people they work with, and the position they hold. But when I actually speak
with an individual who can CONVEY that passion and not just mouth the words, it’s a real treat. So I’m talking to this manager,
and when we challenge her on the passion part, man did she go off. I mean wow. So it’s a software developer position. The
descriptions are basically the same. RubyRubyRubyRuby. Ruby Tuesday, Ruby will you be mine, Jack Ruby, Ruby on rails, Ruby don’t
bring your love to town, Ruby Red, Ruby Web, Ruby Mobile. But what you will be doing, what you will be working on, what you will
discover, what you will learn…Its impossible to convey the excitement this person displayed, the descriptions she gave, the
PASSION she felt for her company and product. This a social media acorn waiting to grow into an oak tree of aggregated real ti
@jackdempsey
jackdempsey / gist:5913815
Last active December 19, 2015 06:49
I'm looking for a word that is defined by the following:
__________ - noun
a situation where one relatively small change can influence the
potential energy of an outcome by orders of magnitude.
example: if you have a fair coin and flip it, you have a 50/50 shot of
heads or tails. An intelligent person would not place wagers on this game if played to infinity.
If you change the weighting and make it 49/51 then that intelligent person
1 var fallacy_buttons = "<a href='#' onclick='$(\".usertext-edit textarea\").val(\"https://yourlogicalfallacyis.com/strawman\");'>strawman</a> | " +
2 "<a href='#' onclick='$(\".usertext-edit textarea\").val(\"https://yourlogicalfallacyis.com/false-cause\");'>false-cause</a>"
3 var buttons = "<div id='logical_fallacy' style='background-color: lightgrey'>" + fallacy_buttons + "</div>";
4
5 $("#header-bottom-left").after(buttons);
foo = ->
alert 'it has it'
@jackdempsey
jackdempsey / config_initializers_active_admin.rb
Created September 5, 2012 01:48
How to define controller methods in one place for ActiveAdmin
109 class ActiveAdmin::BaseController
110 def current_ability
111 @current_admin_ability ||= AdminAbility.new(current_admin_user)
112 end
113
114 def user_for_paper_trail
115 current_admin_user
116 end
117
118 def info_for_paper_trail