Skip to content

Instantly share code, notes, and snippets.

View nicosuave's full-sized avatar

Nico Ritschel nicosuave

View GitHub Profile
@fkchang
fkchang / gist:3956417
Created October 26, 2012 01:07
rails gem file for opal_test - used in OCRuby presentation on opal 10/25/2012
# prerequisites: Ruby 1.9.3, Rails 3.2.something recent
###
### Setup rails app w/haml and opal
###
# create app
rails new opal_test
# add to Gemfile below rails
@michaelparenteau
michaelparenteau / config.ru
Last active January 29, 2016 05:55
Basic Auth Middleman & Heroku
# This is a snippet to add to middleman's config.ru file if you want to add basic auth to your middleman app on heroku
# NOTE: you need to stick this above the build script like shown below
use Rack::Auth::Basic, "Restricted Area" do |username, password|
[username, password] == ['username', 'password']
end
# This part below is just what builds the static site. you only need to add lines 4 - 6 above any build command like shown below.
use Rack::TryStatic, :root => "build", :urls => %w[/], :try => ['.html', 'index.html', '/index.html']
@aiwilliams
aiwilliams / README.md
Created May 16, 2012 13:52
Storyboard in RubyMotion 1.4

Start XCode and create a new Storyboard file. I closed all my other XCode projects. When you choose the location of the created file, it should be your RubyMotion project's resources directory. Add a UIViewController, and set it's identifier property to "Start". Add some UI elements so you can see it working.

When you run rake in your RubyMotion project, it will compile the .storyboard file. You could auto-load the Storyboard using a plist configuration, but you'll see code can do it too.

@guenter
guenter / api.feature
Created June 24, 2010 17:55
Snippets for testing REST APIs with Cucumber and friends
Feature: API
In order to use the service from third party apps
As a user
I want to be able to use an API
Background:
Given a user exists # Pickle
And I login as the user using basic auth
Scenario Outline: Get a ticket
@assimovt
assimovt / README.md
Last active June 8, 2018 22:12
Adds Newrelic RPMs metrics to your dashboard.

Setup

Add the following gems to your Gemfile:

gem 'activeresource'
gem 'newrelic_api'

Update your bundle:

import io.circe._
import io.circe.generic.auto._
import io.circe.parser._
val jsonPoint = "{ \"type\": \"Point\", \"coordinates\": [100.0, 0.0] }"
val jsonLineString = "{ \"type\": \"LineString\",\n \"coordinates\": [ [100.0, 0.0], [101.0, 1.0] ]\n }"
val jsonPolygon = "{ \"type\": \"Polygon\",\n \"coordinates\": [\n [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]\n ]\n }"
val jsonPolygonWithHoles = "{ \"type\": \"Polygon\",\n \"coordinates\": [\n [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],\n [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]\n ]\n }"
val jsonGC = "{ \"type\": \"GeometryCollection\",\n \"geometries\": [\n { \"type\": \"Point\",\n \"coordinates\": [100.0, 0.0]\n },\n { \"type\": \"LineString\",\n \"coordinates\": [ [101.0, 0.0], [102.0, 1.0] ]\n }\n ]\n }"
@pathikrit
pathikrit / README.md
Last active April 24, 2021 17:36
My highly opinionated list of things needed to build an app in Scala
@robhurring
robhurring / Rakefile
Created December 7, 2010 20:09
Delayed Job with Sinatra -- without sinatra specific gems, etc.
task :environment do
require './dj-sinatra'
end
namespace :jobs do
desc "Clear the delayed_job queue."
task :clear => :environment do
Delayed::Job.delete_all
end
@mtowers
mtowers / README.md
Last active February 24, 2022 17:19
Google Analytics Website Visitor Count Widget for Dashing with OAuth2 Authentication
@jamesgary
jamesgary / gist:5491390
Last active July 26, 2022 09:06
The Magic Tricks of Testing - Sandi Metz - RailsConf2013

The Magic Tricks of Testing

Sandi Metz

  • Many people say "I hate my tests"
  • They kill your productivity when they're slow
  • A little change can break your tests (even if they shouldn't)
  • They're expensive
  • They are misery incarnate
  • Just delete some tests
  • You may have too many tests testing the wrong tests