Skip to content

Instantly share code, notes, and snippets.

🛠
Building neat products

Jeffrey Horn jrhorn424

🛠
Building neat products
Block or report user

Report or block jrhorn424

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d4604a2d2a1ca5da2586

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

View vertical-center-child.scss
// Inspired by http://css-tricks.com/vertically-center-multi-lined-text/
@mixin vertical-center-children($height: auto, $children: ':first-child') {
display: table;
height: $height;
#{$children} {
display: table-cell;
vertical-align: middle;
}
}
@jrhorn424
jrhorn424 / _project_using_karma_jasmine_jquery.txt
Last active Aug 29, 2015
Getting jasmine-jquery to work with karma
View _project_using_karma_jasmine_jquery.txt
[project root]
├── app/
│   ├── js/
│   │   └── app.js
│   └── index.html
├── test/
│   ├── spec/
│   │   ├── fixtures/
│   │   │   ├── todo.html
│   │   ├── helper.js
View config_dsl.rb
# Encapsulate the configuration DSL pattern.
#
# Any `X=(value)` setter method on the given +obj+ is translated into `X(value)` method
# in the context of this object.
class ConfigDSL < BasicObject
def initialize(obj, &config)
@self = obj
call(&config)
end
@jrhorn424
jrhorn424 / simple_nuke_pave.rake
Created Oct 21, 2014
Simply drop your database and start again
View simple_nuke_pave.rake
# lib/tasks/db.rake
# execute me with rake db:nuke_pave
namespace :db do
desc "drops, creates, migrates, and seeds database"
unless Rails.env == "Production"
task :nuke_pave => %w(environment db:drop db:create db:migrate db:seed) do
# If you have a sample file that creates data for you to play with locally:
# Rake::Task["db:sample"].execute if Rails.env == "development"
puts "Nuke and pave of #{Rails.env} complete."
View introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

View centered.css
body {
width: 100%;
height: 500px;
margin: 0;
padding: 0;
text-align: center;
}
body:before {
display: inline-block;
content: ' ';
View pair_programming_exercises.md

Number to Ordinal

See full kata at codewars

Finish the function numberToOrdinal, which should take a number and return it as a string with the correct ordinal indicator suffix (in English). That is:

  • numberToOrdinal(1) ==> '1st'
  • numberToOrdinal(2) ==> '2nd'
  • numberToOrdinal(3) ==> '3rd'
  • numberToOrdinal(4) ==> '4th'
@jrhorn424
jrhorn424 / keybase.md
Last active Aug 29, 2015
Keybase Proof
View keybase.md

Keybase proof

I hereby claim:

  • I am jrhorn424 on github.
  • I am jrhorn (https://keybase.io/jrhorn) on keybase.
  • I have a public key whose fingerprint is EA9D 4FC3 908C 7657 08BB 2A11 A2D2 72CF F38D B3A7

To claim this, I am signing this object:

@jrhorn424
jrhorn424 / 0_reuse_code.js
Created Aug 15, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.