Skip to content

Instantly share code, notes, and snippets.

View Cortlandd's full-sized avatar
💭
Learner 😬

Cortland Walker Cortlandd

💭
Learner 😬
View GitHub Profile
@Cortlandd
Cortlandd / retrofit_callback_testing.java
Created April 4, 2020 19:52 — forked from Aesthetikx/retrofit_callback_testing.java
Testing Retrofit Callback style APIs with Robolectric and CountdownLatches
// WidgetApi.java
public interface WidgetApi {
@GET("/widget/{:id}")
void getWidget(@Path("id") int id, Callback<Widget> callback);
}
// MockRetrofitClient.java
public class MockRetrofitClient implements Client {
private int statusCode = 200;
@Cortlandd
Cortlandd / stock.hs
Created June 14, 2016 06:28 — forked from oz/stock.hs
Playing with Yahoo's stock API in Haskell, use this little program to quickly check stock prices, or change currencies.
import Prelude
import System.Environment
import Network.HTTP
import Control.Monad
showUsage :: IO ()
showUsage = do
putStrLn "Usage: stock <options...>\n"
putStrLn " - get a quote: stock <symbol>"
putStrLn " - change money: stock <from> <to> <amount>"

#Scoped Invitation System for User Groups with Rails#

Starting out with the following models and associations:

####User

  • has_many :memberships
  • has_many :organizations through :memberships

####Organization (User Group)

  • has_many :memberships