Skip to content

Instantly share code, notes, and snippets.

@bodokaiser
bodokaiser / context.ts
Last active August 10, 2023 01:00
React Hook integration for AWS Amplify Auth
import React from "react"
import { CognitoUser } from "@aws-amplify/auth"
import { useAuth } from "./hooks"
import { SignInInput } from "./types"
interface AuthState {
user: CognitoUser | null
signIn(input : SignInInput): Promise<void>
signOut(): Promise<void>
@pcreux
pcreux / Gemfile
Last active December 11, 2023 20:24
Fast Rails + Heroku Configuration
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end
@jasonrudolph
jasonrudolph / README.md
Created May 17, 2012 00:07
GitHub README Template
@jwo
jwo / registrations_controller.rb
Created September 30, 2011 23:11
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@netshade
netshade / american _why
Created August 24, 2011 18:52
_catch the lucky whiff's tribute to _why
A long, long time ago...
I can still remember
How his blog used to make me smile.
And I knew that if he had his chance
That he could make their code enhance
And, maybe, they’d be happy for a while.
But August made me shiver
With every code line I’d deliver.
Bad news on the doorstep;
@rmoriz
rmoriz / Gemfile
Last active February 7, 2020 12:30
UUID primary keys in Rails 3
# Gemfile
gem 'uuidtools'
@joemccann
joemccann / phonegap_sencha_tutorial.md
Created January 31, 2011 20:19
Quick setup of Phonegap and Sencha tutorial.

Note: You need to be on a Mac.

Note: This is purposely verbose. Yes, I know a lot of this can be simplified. Fork it and show me.

  1. Install git
  2. Open your terminal.
  3. mkdir ~/Documents/phonegap_sencha
  4. cd ~/Documents/phonegap_sencha
  5. git clone https://github.com/phonegap/phonegap-iphone.git && cd phonegap-iphone
  6. git reset --hard HEAD
module Kernel
def the(a, b)
Exception.new
end
def roof
end
def yo!
end