This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// after running `vagrant ssh` to log into VM: | |
// sudo su - osehra | |
// cd ewdjs | |
var ewdGlobals = require('ewdjs/lib/ewdGlobals'); | |
var interface = require('nodem/lib/mumps'); | |
var db = new interface.Gtm(); | |
var util = require('util'); | |
var ok = db.open(); | |
ewdGlobals.init(db); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# To enable this hook, rename this file to "pre-commit". | |
PRY_PATTERN="require.+[\'\"]pry[\'\"]|binding\.pry" | |
# Redirect output to stderr. | |
exec 1>&2 | |
if git diff --cached | grep '^\+' | grep -q -E $PRY_PATTERN; then | |
echo "ERROR: There is left over pry stuff in this commit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,300,600,700" media="all" rel="stylesheet"> | |
<h1>This is H1 Text</h1> | |
<h2>This is H2 Text</h2> | |
<h3>This is H3 Text</h3> | |
<h4>This is H4 Text</h4> | |
<h5>This is H5 Text</h5> | |
<h6>This is H6 Text</h6> | |
<hr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'spreadsheet' | |
require 'capybara' | |
require 'csv' | |
include Capybara::DSL | |
COL_CDCR = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def progress_bar(current, total, width=80) | |
pos = (current.to_f / total * width).round | |
print "\r|#{'=' * pos}#{'-' * (width - pos)}|" | |
puts if current == total | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% for i in 1..1000 %> | |
joe_<%= i %>: | |
login: joe_<%= i %> | |
email: joe_<%= i %>@example.com | |
salt: 356a192b7913b04c54574d18c28d46e6395428ab # SHA1('0') | |
crypted_password: 6480dd200db2719d431c7a25b133887ad8b46551 # 'monkey' | |
created_at: <%= 5.days.ago.to_s :db %> | |
activated_at: <%= 5.days.ago.to_s :db %> | |
state: active | |
invitation: <%= Fixtures.identify("#{i}_invite") %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Specialty < ActiveRecord::Base | |
named_scope :all_by_popularity, | |
:select => 'specialties.*, count(specialties.id) AS c', | |
:joins => :stores, | |
:group => 'specialties.id', | |
:order => 'c DESC' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Group | |
include DataMapper::Resource | |
# ... no need to paste everything, right? | |
has n, :users, :through => Resource | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain | |
class ApplicationController < ActionController::Base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> problems.size | |
=> 99 | |
>> problems.include? "a bitch" | |
=> false |
OlderNewer