Skip to content

Instantly share code, notes, and snippets.

View tcmacdonald's full-sized avatar
🪕

Taylor MacDonald tcmacdonald

🪕
  • Ample
  • Cincinnati, OH
View GitHub Profile
@tcmacdonald
tcmacdonald / question-marks.rb
Created November 9, 2018 20:36
Coding Challenge #2
def question_marks(str)
# Get any number + chars + number pattern...
regex = /(\d)[a-zA-Z\?]*(\d)/
# Iterate over each occurrence and return the MatchData object
matches = str.to_enum(:scan, regex).map { Regexp.last_match }
# Iterate over each match and return a boolean meeting the following conditions...
bools = matches.collect do |match|
<!-- ID: 873 -->
<div class="container-fluid sticky-top">
<div class="row">
<a href="javascript:void(0)" class="btn btn-live-schedule-trigger hidden-xs" data-smooth-scroll-to="live-stream-schedule"
data-smooth-scroll-offset="92">
<span>See Schedule</span>
<svg class="icon icon-1" viewbox="0 0 256 256">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/assets/svgs/icons.svg#chevron-down"></use>
</svg>
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/home/ubuntu/sites/something-com/shared/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name something.com;
root /home/ubuntu/sites/something-com/current/public;
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage unicorn server
# Description: Start, stop, restart unicorn server for a specific application.
### END INIT INFO
--
-- open currently active Chrome tab with Safari
-- forked from https://gist.github.com/3151932 and https://gist.github.com/3153606
--
property theURL : ""
tell application "Google Chrome"
set theURL to URL of active tab of window 0
end tell
if appIsRunning("Safari") then

Keybase proof

I hereby claim:

  • I am tcmacdonald on github.
  • I am tcmacdonald (https://keybase.io/tcmacdonald) on keybase.
  • I have a public key whose fingerprint is 8364 00E2 13F8 F969 6EC1 D875 8D50 EB66 1F9A 781E

To claim this, I am signing this object:

# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@tcmacdonald
tcmacdonald / poltergeist.rb
Created April 21, 2014 13:43
Poltergeist sliencer
module Capybara::Poltergeist
class Client
private
def redirect_stdout
prev = STDOUT.dup
prev.autoclose = false
$stdout = @write_io
STDOUT.reopen(@write_io)
@tcmacdonald
tcmacdonald / conditions.js.coffee
Created September 23, 2013 17:40
Conditions provides a simple API for conditional JS behaviors. This allows a developer to show or hide certain sections of a stepped-form based on the user's response in previous sections. For every condition, a session cookie is set providing very basic persistance of control-flow for clients.
# **Conditions** provides a simple API for conditional behaviors within the <a href="/docs/form.js.html">Form</a> class. This allows a developer to show or hide certain sections of a stepped-form based on the user's response in previous sections.
# For every condition, a session cookie is set providing very basic persistance of control-flow for clients.
# ### Usage
# Every action item (button, link) that carries a condition must define the following attributes...
#
# <pre>
# data-condition="#target_selector"
# data-conditional-group="some_group"