Skip to content

Instantly share code, notes, and snippets.

Tom Milewski tmilewski

Block or report user

Report or block tmilewski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matt-bailey
matt-bailey / formstack-embed-using-postscribe.html
Created Sep 13, 2017
Embed a Formstack form asynchronously, using Postscribe
View formstack-embed-using-postscribe.html
// https://github.com/krux/postscribe
<!-- Main form wrapper, required for styling the form -->
<div class="webform">
<!-- Empty div (must have a unique ID), into which the form will be loaded -->
<div id="formstack-bridal-appointment"></div>
<script type="text/javascript">// <![CDATA[
// Only run the code below when jQuery says the document is ready
(function($) {
// Process the form using postscribe:
// 1. Must reference the unique ID of the div above
@bensheldon
bensheldon / app_delegate.rb
Last active May 12, 2018
Creating a flat navigation bar in a RubyMotion iOS iPhone app. (screenshot in the comments)
View app_delegate.rb
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
# ...
navigation_appearance
#...
end
def navigation_appearance
# Background Color
View ie8-grid-foundation-4.css
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@tmilewski
tmilewski / facebook_registration.rb
Created May 7, 2012 — forked from nicalpi/facebook_registration.rb
Testing Omniauth with Devise, Rspec and Capybara
View facebook_registration.rb
background do
set_omniauth()
click_link_or_button 'Sign up with Facebook'
end
@paulnicholson
paulnicholson / powssl
Last active Jul 11, 2018
ssl with pow using stud
View powssl

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
    • $ powssl
@cpatni
cpatni / app.rb
Created Nov 21, 2011
unique calculation using redis
View app.rb
require 'sinatra'
require 'redis'
require 'json'
require 'date'
class String
def &(str)
result = ''
result.force_encoding("BINARY")
View lowerword.sql
-- --------------------------------------------------------------------------------
-- Routine DDL
-- --------------------------------------------------------------------------------
DELIMITER $$
CREATE DEFINER=`root`@`localhost` FUNCTION `lowerword`( str VARCHAR(128), word VARCHAR(5) ) RETURNS varchar(128) CHARSET utf8
BEGIN
DECLARE i INT DEFAULT 1;
DECLARE loc INT;
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
View rturk.rb
RTurk.setup(AWSAccessKeyId, AWSAccessKey, :sandbox => true)
hit = RTurk::Hit.create(:title => "New Upload 3 Documents") do |hit|
hit.assignments = 500
hit.description = "no copytrighted materials!"
hit.question("http://localhost:3000/mturk")
hit.reward = 0.10
hit.qualifications.add :approval_rate, { :gt => 85 }
end
You can’t perform that action at this time.