Skip to content

Instantly share code, notes, and snippets.

View mtmcfarl's full-sized avatar

Matthew McFarling mtmcfarl

View GitHub Profile
@mtmcfarl
mtmcfarl / hookable.rb
Last active August 29, 2015 13:56
Example of a web hook
module Hookable
extend ActiveSupport::Concern
def perform_post
end
end
# encoding: utf-8
class AssetUploader < CarrierWave::Uploader::Base
cattr_accessor :current_account
# Include RMagick or ImageScience support:
include CarrierWave::RMagick
# include CarrierWave::ImageScience
# Choose what kind of storage to use for this uploader:
#storage :file
@mtmcfarl
mtmcfarl / csv.rb
Created May 30, 2012 22:55
appending to csv
require 'csv'
CSV.open('new_list.csv', 'wb') do |csv_out|
CSV.foreach('data.csv', :headers => true, :return_headers => true) do |rec|
csv_out << rec
end
end

I finally got to talk with the attorney today about designing a website for them.

They are a small group, 8 attorneys in G'boro and 2 in Asheville. Their practice is mainly medical-based, I think they work with healthcare groups and med/tech developers, so not ambulance chasers. They are mainly looking to establish a presence for marketing—not a lot of pages, but they don't currently have any content or images, so really, starting from scratch.

I'm thinking a Wordpress template so they can handle CMS once the project is complete, but I'll take your advice on that if you think something else would work better. Do you think we would need a designer, or could we manage comps and wireframes between us?

I'll also talk to a photographer I know, I can probably handle the copywriting side.

I got the impression the guy I'm talking to is the one really pushing for this, and the older attorneys are not convinced of the need for a web presence. I was very clear with him that the upfront costs might be higher than the

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
// Once this method is invoked, "responseData" contains the complete result
NSLog(@"Succeeded! Received %d bytes of data", [receivedData length]);
NSString *dataStr=[[NSString alloc] initWithData:receivedData encoding:NSASCIIStringEncoding];
NSLog(@"Succeeded! Received %@ bytes of data", dataStr);
if ([delegate respondsToSelector:@selector(didFinishDownload:)]) {
NSLog(@"Calling the delegate");
//NSString* dataAsString = [[[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding] autorelease];
asdfasdfadsf
@mtmcfarl
mtmcfarl / unicorn.conf
Created October 17, 2015 12:38 — forked from witscher/unicorn.conf
Upstart script for unicorn, bundler and a user contained rvm installation
description "Unicorn"
# starting unicorn with bundler, and a user contained rvm:
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
chdir /path/to/current
class VendorContactPresenter < BasePresenter
def initialize(contact)
@contact = contact
end
def full_name
"#{@contact.first_name} #{@contact.last_name}"
end
def email
@mtmcfarl
mtmcfarl / gist:6879800
Created October 8, 2013 05:15
appbuilder.log
0 INFO [main] utilities.LoggingSetup - {java.runtime.name=Java(TM) SE Runtime Environment, sun.boot.library.path=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries, java.vm.version=20.51-b01-457, awt.nativeDoubleBuffering=true, gopherProxySet=false, mrj.build=11M4509, java.vm.vendor=Apple Inc., java.vendor.url=http://www.apple.com/, path.separator=:, java.vm.name=Java HotSpot(TM) 64-Bit Server VM, file.encoding.pkg=sun.io, sun.java.launcher=SUN_STANDARD, user.country=US, sun.os.patch.level=unknown, java.vm.specification.name=Java Virtual Machine Specification, user.dir=/Volumes, java.runtime.version=1.6.0_51-b11-457-11M4509, java.awt.graphicsenv=apple.awt.CGraphicsEnvironment, java.endorsed.dirs=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/endorsed, os.arch=x86_64, java.io.tmpdir=/var/folders/34/qn5pdvbj5m39fwr_tj11ptkm0000gn/T/, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., os.name=Mac OS X, sun.jnu.encoding=MacRoman, java.library.path=.
class ContactsController < ApplicationController
def create
ContactFormMailer.contact_request(contact_params).deliver
render action: :thanks
end
protected
def contact_params
params[:contact].permit!