Skip to content

Instantly share code, notes, and snippets.

View danieljohnmorris's full-sized avatar
😀

Daniel Morris danieljohnmorris

😀
View GitHub Profile
@serjKim
serjKim / gist:7f453992211637731d2f4d762c60f7a5
Last active July 6, 2022 21:43
integrate expo to the existing project
  1. add app.json, set the newest sdkVersion
{
  "name": "<yourname>",
  "displayName": "<yourname>",
  "expo": {
    "sdkVersion": "25.0.0"
  }
}
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@elithrar
elithrar / stripe-config.js
Created November 27, 2013 00:40
Example Stripe Checkout - Custom Integration for #stripe
// Disable the payment/submit button until everything has loaded
// (if Stripe fails to load, we can't progress anyway)
$(document).ready(function() {
$("#payment-button").prop('disabled', false)
})
var handler = StripeCheckout.configure("customButtonA", {
key: '<yourpublishablekey',
token: function(token, args){
var $input = $('<input type=hidden name=stripeToken />').val(token.id);
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
@joncode
joncode / gist:6274015
Last active December 21, 2015 07:49
Attachinary how to add ...

Setup


  1. add the cloudinary and attachinary Rails 4 gems

    gem 'cloudinary'

    gem 'attachinary', git: 'git://github.com/rochers/attachinary.git', branch: 'rails4'

@danieljohnmorris
danieljohnmorris / artist_cowboy_antics.rb
Last active December 15, 2015 04:28
In Ruby you can be an artist and a cowboy, after all!
class Person
attr_accessor :pocket
end
class Artist < Person
def draw_like_an_artist
"Look, I painted a landscape."
end
end
@dennysfredericci
dennysfredericci / validator
Created July 2, 2012 03:56
An easy way to use JQuery Validation with Twitter Bootstrap Popover
$('form').validate(
{
rules: {
numero: {
required: true
},
descricao: {
minlength: 3,
email: true,
required: true
@romanbsd
romanbsd / stathat.rb
Created May 22, 2012 13:11
Stathat API using Faraday
require 'faraday'
module StatHat
module API
extend self
CLASSIC_VALUE_URL = "http://api.stathat.com/v".freeze
CLASSIC_COUNT_URL = "http://api.stathat.com/c".freeze
EZ_URL = "http://api.stathat.com/ez".freeze
def post_value(stat_key, user_key, value)
@arirusso
arirusso / video-example.rb
Created March 27, 2012 23:54
ruby-processing: video processing example
#!/usr/bin/env ruby
# this is a test of ruby-processing (https://github.com/jashkenas/ruby-processing) with the video library
# use "rp5 unpack library" at a command line to install the video library, among others
# tested with Ruby 1.9.2
# video file: http://bit.ly/H5yBjK
class VideoTest < Processing::App
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)