Skip to content

Instantly share code, notes, and snippets.

Avatar

Terence Lee hone

View GitHub Profile
View gist:13243
#include <string>
#include "image_loader.h"
#include <cv.h>
#include <highgui.h>
/**
* constructs a box filter. a matrix with all 1s and is normalized.
* @param size of box filter as an int.
*/
void makeBoxFilter( CvMat * mat, int w )
View gist:24697
#include <mpi.h>
#include <iostream>
#include <string.h>
#include <gameoflife.hpp>
const int DIMENSIONS = 16;
const int DEAD = 0;
const int ALIVE = 1;
const int ITERATIONS = 64;
const int LENGTH = DIMENSIONS * DIMENSIONS;
View .screenrc
# detach on hangup
autodetach on
# # don't display the copyright page
startup_message off
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
# terminfo and termcap for nice 256 color terminal
View gist:161804
=> Mixing in Lockdown version: 1.1.0
=> Requiring Lockdown rules engine: /home/hone/Projects/oib/boxboss/lib/lockdown/init.rb
DashboardController
responding to GET index
>> Lockdown: Permission not found in db: Login, creating.
>> Lockdown: Permission not found in db: Venue Director Dashboard, creating.
>> Lockdown: Permission not found in db: Register Account, creating.
>> Lockdown: Permission not found in db: My Account, creating.
>> Lockdown: UserGroup not in the db: Venue Director, creating.
should redirect to the login page if the user is not logged in
View gist:164630
In a Clarion workshop, victims, I mean participants, usually sit or lounge in a
rough circle, where each in turn has to sit silently while every other participant
attacks, I mean critiques, the victim’s baby, I mean manuscript. The process
is brutal at the start, but because everyone is both attacker and attacked, most
participants soon learn valuable lessons in how to take and give criticism. And
until you’ve learned to take criticism you will always meet barriers to growth
in your craft.
View gist:169206
$ bin/git_pivot current_sprint
+--------------------------------------------------+
| ID | Type | Owner | State | Name |
+--------------------------------------------------+
| 683969 | feature | | unstarted | RT action |
+--------------------------------------------------+
View gist:170411
class Test
def self.foo
puts 'hi'
end
def self.boo
puts 'world'
end
end
[:foo, :boo].each {|method_name| Test.send(method_name) }
View gist:171383
# normal new.html.erb
<<ERB
<p>This is some text</p>
ERB
# outputting a variable name,
# name = "joe"
<<ERB
<p>Hello <%= name %></p>
ERB
View gist:175612
hone@hone-x200:~/Projects/oib/boxboss$ git_pivot display_story 1082027
+--------------------------------------------------------------------------------+
| Element | Value |
+--------------------------------------------------------------------------------+
| id | 1082027 |
| name | authorization redirect lockdown should be dependent on context |
| current_state | finished |
| estimate | 5 |
| iteration | |
| story_type | feature |
View sanitize_email.rb
# Settings for sanitize_email gem. These can be overridden in individual config/%env%/environment.rb files.
require 'sanitize_email'
ActionMailer::Base.sanitized_recipients = ["#{`whoami`.chomp}@#{`hostname`}"]
ActionMailer::Base.sanitized_bcc = nil
ActionMailer::Base.sanitized_cc = nil
# These are the environments whose outgoing email BCC, CC and recipients fields will be overridden!
# All environments not listed will be treated as normal.
ActionMailer::Base.local_environments = %w( development )
You can’t perform that action at this time.