Skip to content

Instantly share code, notes, and snippets.

View ppamorim's full-sized avatar
🎯
Focusing

Pedro Paulo Amorim ppamorim

🎯
Focusing
View GitHub Profile
@ppamorim
ppamorim / Just.java
Last active November 10, 2015 13:43 — forked from haskellcamargo/Just.java
Maybe monad implementation in Java 7
package br.com.ngi.monad;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Just<T> extends Maybe<T> {
private T type;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.ButterKnife;
public abstract class AbstractFragment extends Fragment {
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container,
import Foundation
import FBSDKCoreKit
import FBSDKLoginKit
class FacebookAuth {
class func auth(callback: (Bool) -> (), viewController: UIViewController) {
let parameters = ["fields" : "id,name,email"]
let facebookReadPermissions = ["public_profile", "email", "user_friends"]
[{
"user": {
"id":12,
"name":"John",
"profilePicture":"http://www.mtv.com/shared/media/images/amg_artist_portraits/standard/drp500/p555/p55532ltjus.jpg"
},
"id":0,
"content":"Look that sunny day! Amazing!",
"image":"https://c2.staticflickr.com/6/5553/14877377949_041f533fda_b.jpg"
},{
@ppamorim
ppamorim / flood.py
Created February 1, 2016 16:08
Code for satan
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
def test():
import PureLayout
class TableViewMultiView : UIView {
var didLoadView = false
let tableView : UITableView = {
let tableView = UITableView.newAutoLayoutView()
tableView.keyboardDismissMode = .OnDrag
tableView.separatorInset.right = tableView.separatorInset.left
import UIKit
/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
Error:Error converting bytecode to dex:
Cause: local 0008: invalid
Error:com.android.dx.cf.code.SimException: local 0008: invalid
Error: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Error: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
Error: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
Error: at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
Error: at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
Error: at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
Error: at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)
import android.content.Context
import io.realm.*
import io.realm.internal.RealmCore
import io.realm.log.RealmLog
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.`when`
import org.mockito.Matchers.`any`
/**
* Just create a new project, add Realm dependency, enable minify (and add the Realm's proguard info) and run the test.
*/
@RunWith(AndroidJUnit4::class)
class RepositoryTest {
lateinit var realm: Realm
private fun cleanDatabase(realm: Realm) {
realm.executeTransaction {