Skip to content

Instantly share code, notes, and snippets.

View LamourBt's full-sized avatar

Lamour LamourBt

  • NY
View GitHub Profile
@LamourBt
LamourBt / lambda-dynamo
Created February 12, 2016 19:51 — forked from markusklems/lambda-dynamo
Short aws lambda sample program that puts an item into dynamodb
// create an IAM Lambda role with access to dynamodb
// Launch Lambda in the same region as your dynamodb region
// (here: us-east-1)
// dynamodb table with hash key = user and range key = datetime
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
exports.handler = function(event, context) {
@LamourBt
LamourBt / gist:130e5d2479893fef8d83b45ede7655f2
Created July 15, 2016 04:00
Facebook Login Swift 2.0 and Parse-Server (latest version)
// Mark: -Facebook
func loginWithFaceBookInBackground(sender:UIButton) {
let permissions = ["public_profile", "email"]
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) { (_user:PFUser?, _error:NSError?) in
if _error == nil {
if let possibleUser = _user{
print("\(possibleUser.sessionToken) , \(possibleUser)")
if possibleUser.isNew {
self.accessingFacebookCredentialsToSaveToParse()
@LamourBt
LamourBt / ultimate-ut-cheat-sheet.md
Created March 19, 2017 01:36 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@LamourBt
LamourBt / ultimate-ut-cheat-sheet.md
Created March 19, 2017 01:36 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@LamourBt
LamourBt / redux.swift
Created October 26, 2017 19:33
Redux Architecture in iOS
import PlaygroundSupport
import Foundation
import UIKit
PlaygroundPage.current.needsIndefiniteExecution = true
//data model
struct User {
let name:String
}
enum Result<T> {
@LamourBt
LamourBt / resetAllSimulators.sh
Created January 17, 2018 20:08 — forked from ZevEisenberg/resetAllSimulators.sh
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
/*
An Object is considered to be a **functor** when it implements fmap (fmap referring to functor map not flatmap)
-[Rules] This fmap should
* preserve Identity (x to y) and (y to x ) should be the same value every time
* and be composable
map isn't fmap but fmap can do what map does
map only operates on pure function, where fmap is lifted that pure function to operate on functor type
*/
@LamourBt
LamourBt / introrx.md
Created March 28, 2018 23:19 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
import Foundation
import RxSwift
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class TryOut {
private var timer: Timer!
private let data = Array<Int>(1...5) // data to broadcast asynchronously
@LamourBt
LamourBt / RxJava.md
Created August 28, 2018 19:19 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)