Skip to content

Instantly share code, notes, and snippets.

View stupakov's full-sized avatar

Alex Stupakov stupakov

  • Pivotal
  • San Francisco
View GitHub Profile
Scenario: User is not signed up # features/users/sign_in.feature:6
Given I am not logged in # features/step_definitions/user_steps.rb:69
And no user exists with an email of "user@test.com" # features/step_definitions/user_steps.rb:1
undefined method `add_assertion' for nil:NilClass (NoMethodError)
/Users/stupakov/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/test/unit/testcase.rb:125:in `add_assertion'
/Users/stupakov/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/test/unit/assertions.rb:494:in `_wrap_assertion'
/Users/stupakov/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_block'
/Users/stupakov/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/test/unit/assertions.rb:83:in `assert_equal'
/Users/stupakov/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/test/unit/assertions.rb:172:in `assert_nil'
./features/step_definitions/user_steps.rb:2:in `/^no user exists with an email of "(.*)"$/'
// Calculator Constructor
var Calculator = function() {
//private
var q = [0];
var makeRpnFunction = function(op) {
return function() {
var v1 = q.pop();
if (v1 == undefined) {
@stupakov
stupakov / weather_and_maps.html
Created July 9, 2011 18:23
Weather + Maps exercise.
<html>
<head>
<title>Hello</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
TO PAYPAL:
https://www.sandbox.paypal.com/cgi-bin/webscr?a3=9&business=seller_1309413530_biz%40gmail.com&cmd=_xclick-subscriptions&currency_code=USD&invoice=32&item_name=XXX&item_number=XXX&notify_url=http%3A%2F%2Flocalhost%3A3000%2Fpayment_notifications&p3=1&return=http%3A%2F%2Flocalhost%3A3000%2Fcomplete_registrations%2Fnew%3Fsubscription_id%3D32&src=1&t3=M&upload=1
FROM PAYPAL:
GET http://localhost:3000/complete_registrations/new?invoice=30&amount3=9.00&address_status=confirmed&subscr_date=19%3A36%3A44+Jul+28%2C+2011+PDT&payer_id=C3BBVG2KVL9H2&address_street=1+Main+St&mc_amount3=9.00&charset=windows-1252&address_zip=95131&first_name=Test&reattempt=1&address_country_code=US&address_name=Test+User&notify_version=3.2&subscr_id=I-X1YLB35UYVGM&payer_status=verified&business=seller_1309413530_biz%40gmail.com&address_country=United+States&address_city=San+Jose&verify_sign=AO0VU3VIWAwosaKuXWbwhuA3w02gAMzJXmPnBD8usG-ZtCAREp0aOrm1&payer_email=buyer_1310094558_per%40gmail.com&last_name=User&address_state=CA&receiver
@stupakov
stupakov / gist:4367456
Created December 24, 2012 04:08
Nacre - Create class for resources, then subclass each resource
module Nacre
module API
class ProductServiceResource # Abstract Class
def self.api
Nacre::Api.global_instance
end
def self.all
search
end
@stupakov
stupakov / gist:11227904
Created April 23, 2014 18:50
Encrypted USB Drive + SSH key directions

In case you haven't yet set up an encrypted USB drive yet, this article has clear directions on how to encrypt an entire USB drive. If you don't have a USB drive that you want encrypted, please talk to your anchor or send an ask ticket for a USB drive that you can dedicate to this purpose.

From there, you can follow GitHub's directions for adding a new SSH key to your account, making sure to save the key on your now-encrypted drive (not the default location in your home directory). Please use a password different from the USB drive's password and different from your GitHub account password. (Since you're already in your account settings, this would also be a great time to enable two-factor authentication on GitHub as well.)

Then, to make it super-easy to just plug in your USB key and activate your SSH ke

@stupakov
stupakov / gist:f0bf4fc7aa1e6c6ab337
Last active August 29, 2015 14:01
referralcandy debugging

MD5 was generated by:

# ruby
string = [email, first_name, invoice_amount, timestamp, account_secret].join(',')
Digest::MD5.hexdigest(string)

(Values are not URI-escaped before computing the MD5 sum.)

@stupakov
stupakov / gist:c51515945b8738f10862
Created May 20, 2014 02:34
referralcandy debugging - attempt 2

MD5 was generated by:

# ruby
string = [email, first_name, invoice_amount, timestamp, account_secret].join(',')
Digest::MD5.hexdigest(string)

(Values are not URI-escaped before computing the MD5 sum.)

@stupakov
stupakov / gist:5fcb30b80fa86a13f447
Created July 23, 2014 22:00
Logs from mysql node 0, observing the addition of a node 1. Contains successful SST followed by errors (presumably due to replication of data created by mysql_upgrade)
140723 21:00:28 [Note] WSREP: Shifting SYNCED -> DONOR/DESYNCED (TO: 2391)
140723 21:00:28 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
140723 21:00:28 [Note] WSREP: Running: 'wsrep_sst_rsync --role 'donor' --address '10.244.1.6:4444/rsync_sst' --auth '(null)' --socket '/var/vcap/sys/run/mysql/mysqld.sock' --datadir '/var/vcap/store/mysql/' --defaults-file '/etc/mysql/my.cnf' '' --gtid '639c752a-11fe-11e4-bd3a-83e44d1f3812:2391''
140723 21:00:28 [Note] WSREP: sst_donor_thread signaled with 0
140723 21:00:28 [Note] WSREP: Flushing tables for SST...
140723 21:00:28 [Note] WSREP: Provider paused at 639c752a-11fe-11e4-bd3a-83e44d1f3812:2391 (5)
140723 21:00:28 [Note] WSREP: Tables flushed.
140723 21:00:28 [Warning] WSREP: error executing 'SET GLOBAL innodb_disallow_writes=1': 1193 (Unknown system variable 'innodb_disallow_writes'). Was mysqld built with --with-innodb-disallow-writes ?
140723 21:00:28 [ERROR] WSREP: Failed to disallow InnoDB writes
140723 21:00:39 [Warning] WSREP: error
@stupakov
stupakov / butterfleye-wufoo-css.css
Created December 13, 2014 22:02
Butterfleye Wufoo Form CSS
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro);
.wufoo{
font-family: 'Source Sans Pro', sans-serif;
}