This file contains hidden or 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
| # Generate a token by looping and ensuring does not already exist. | |
| def generate_token(column) | |
| loop do | |
| token = Devise.friendly_token | |
| break token unless to_adapter.find_first({ column => token }) | |
| end | |
| end |
This file contains hidden or 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
| signature = "" | |
| signature << "id=#{id}" | |
| signature << "carrier=#{carrier}" | |
| signature << "wireless_number=#{wireless_number}" | |
| signature << "status=#{status}" | |
| signature << "secret=#{PUBLICATION_SECRET}" | |
| signature = Digest::SHA1.hexdigest(signature) | |
| puts signature |
This file contains hidden or 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
| swb-mbp% knife cookbook upload apache2 | |
| Uploading apache2 [1.1.12] | |
| /Users/scottwb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/openssl/buffering.rb:174:in `sysread_nonblock': Connection reset by peer (Errno::ECONNRESET) | |
| from /Users/scottwb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/openssl/buffering.rb:174:in `read_nonblock' | |
| from /Users/scottwb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill' | |
| from /Users/scottwb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil' | |
| from /Users/scottwb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/protocol.rb:132:in `readline' | |
| from /Users/scottwb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line' | |
| from /Users/scottwb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:2551:in `read_new' | |
| from /Users/scottwb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request' |
This file contains hidden or 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
| { | |
| "candidate" : { | |
| // Required Fields | |
| "firstName" : "Scott", | |
| "lastName" : "Bradley", | |
| "email" : "[email protected]", | |
| "currentPosition" : "VP of Engineering", | |
| "currentCompany" : "Validas, LLC", | |
| "location" : "Kirkland, WA", | |
| "message" : "You should hire me because...", // markdown |
This file contains hidden or 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
| { | |
| // Required Fields | |
| "firstName" : "Scott", | |
| "lastName" : "Bradley", | |
| "email" : "[email protected]", | |
| "currentPosition" : "VP of Engineering", | |
| "currentCompany" : "Validas, LLC", | |
| "location" : "Kirkland, WA", | |
| "message" : "You should hire me because...", // markdown | |
| "resume" : "http://...", |
This file contains hidden or 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
| swb-mbp% curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"candidate":{"firstName":"Scott","lastName":"Bradley","email":"[email protected]","currentPosition":"VP of Engineering","currentCompany":"Validas, LLC","location":"Kirkland, WA","message":"You should hire me because...","resume":"http://....","position":"linux","twitter":"@scottwb69","github":"scottwb","website":"http://scottwb.com/","blog":"http://scottwb.com/","otherLink1":"http://foo.com/","otherLink2":"http://bar.com/","test":true}}' http://jobsapi.validas.com/candidates.json | |
| * About to connect() to jobsapi.validas.com port 80 (#0) | |
| * Trying 23.22.208.238... connected | |
| * Connected to jobsapi.validas.com (23.22.208.238) port 80 (#0) | |
| > POST /candidates.json HTTP/1.1 | |
| > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 | |
| > Host: jobsapi.validas.com | |
| > Accept: application/json | |
| > Content-type: application/json | |
| > Content-Length: 444 |
This file contains hidden or 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
| wb-mbp% whereis gcc | |
| /usr/bin/gcc | |
| swb-mbp% gcc --version | |
| i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) | |
| Copyright (C) 2007 Free Software Foundation, Inc. | |
| This is free software; see the source for copying conditions. There is NO | |
| warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| swb-mbp% /usr/bin/gcc-4.2 --version | |
| i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) |
This file contains hidden or 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
| namespace :coffee do | |
| task :compile, :filename do |t, args| | |
| filename = args.filename | |
| puts CoffeeScript.compile(File.open(filename)) | |
| end | |
| end |
This file contains hidden or 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
| // Gracefully handle AddThis hashes with jQuery Mobile | |
| $(function() { | |
| if (window.location.hash != '') { | |
| window.location.href = window.location.href.split('#')[0]; | |
| } | |
| }); |
This file contains hidden or 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
| [root@ip-10-0-0-156 ~]# yum install dos2unix | |
| Loaded plugins: fastestmirror, priorities, security, update-motd | |
| Loading mirror speeds from cached hostfile | |
| Could not retrieve mirrorlist http://repo.us-west-2.amazonaws.com/latest/main/mirror.list error was | |
| 12: Timeout on http://repo.us-west-2.amazonaws.com/latest/main/mirror.list: (28, 'connect() timed out!') | |
| Could not retrieve mirrorlist http://repo.us-west-2.amazonaws.com/latest/updates/mirror.list error was | |
| 12: Timeout on http://repo.us-west-2.amazonaws.com/latest/updates/mirror.list: (28, 'connect() timed out!') | |
| * amzn-main: packages.us-west-2.amazonaws.com | |
| * amzn-updates: packages.us-west-2.amazonaws.com | |
| http://packages.us-west-2.amazonaws.com/2012.03/main/24ff18fc5683/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://packages.us-west-2.amazonaws.com/2012.03/main/24ff18fc5683/x86_64/repodata/repomd.xml: (28, 'connect() timed out!') |