Skip to content

Instantly share code, notes, and snippets.

View abaird's full-sized avatar

Alan Baird abaird

  • CoverMyMeds
  • Austin, TX
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script>
<script src="https://fb.me/react-0.14.0.js"></script>
<script src="https://fb.me/react-dom-0.14.0.js"></script>
<script src="https://wzrd.in/standalone/expect@latest"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script>
<script src="https://fb.me/react-0.14.0.js"></script>
<script src="https://fb.me/react-dom-0.14.0.js"></script>
@abaird
abaird / index.html
Last active March 14, 2018 22:21
Getting Started w/ Redux: JS Bin// source https://jsbin.com/guduwis
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script>
<script src="https://fb.me/react-0.14.0.js"></script>
<script src="https://fb.me/react-dom-0.14.0.js"></script>
@abaird
abaird / gist:e2499ba78721c40617038afcf65febc4
Created May 11, 2017 23:23
Login to my site with JMeter
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.9" jmeter="3.0 r1743807">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
@abaird
abaird / gist:bbade7388b941d0a671c
Last active August 29, 2015 14:18
Vim resources
@abaird
abaird / output.txt
Last active January 3, 2020 09:54
Run tests with RSpec formatter in Rake task
require 'rspec/core/rake_task'
require 'ci/reporter/rake/rspec'
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = ['--format html', '--out spec/reports/results.html']
t.pattern = 'spec/heartbeat/heartbeat_spec.rb'
end
task :clean do
rm_rf 'spec/reports'
@abaird
abaird / gist:239320
Created November 20, 2009 06:17
Solution for AnimalQuiz
class QuestionNode
attr_accessor :question, :y_pointer, :n_pointer, :parent_pointer
def initialize(question)
@question = question
@y_pointer = nil
@n_pointer = nil
@parent_pointer = nil
end
def ask_question
puts "#{question} (y or n)"
@abaird
abaird / rest-client-twitter-example.rb
Created April 17, 2009 16:08
rest-client example using twitter api
# This program uses the twitter api to get a user's latest status update.
# Change the user variable to the twitter user you want to see the update from.
# You will need to supply your twitter login credentials in the resource variable.
# You can read more about twitter's api here: http://apiwiki.twitter.com/
# you will need rest_client, get it by typing "gem install rest_client"
require 'rest_client'
require 'rexml/document'
user = 'some_user'
@abaird
abaird / watircraft basic auth login example
Created April 8, 2009 00:40
This is an example of the login script that I was able to get working for my site as I implemented it in WatirCraft. I will post the files for handle_login.rb and handle_security_alert.rb in the future. Also, there is a method installed_ie_version that
require 'rubygems'
require 'taza'
require 'watir/ie'
module Application
include ForwardInitialization
class Application < ::Taza::Site
attr_accessor :env, :username, :password, :url, :br
def initialize_browser
@abaird
abaird / collect! tricks.rb
Created March 27, 2009 20:10
collect! tricks from ruby on windows blog
#~ The code:
object.ole_methods.collect!{ |x| x.to_s }.include?( 'MethodName' )
#~ The explanation:
#~ As mentioned previously here, calling the ole_methods method on a WIN32OLE object returns an array of WIN32OLE objects that represent methods that can be called on that object. You can convert each object in the array to a string, using the collect! method. Then it's a simple matter to call the include? method to see if the resulting array of strings contains a certain value.
#~ And so we can use this to find that the Excel application object includes a Quit method...