Skip to content

Instantly share code, notes, and snippets.

View brunodles's full-sized avatar

Bruno de Lima e Silva brunodles

  • São Paulo, São Paulo - Brasil
View GitHub Profile
@brunodles
brunodles / routes.js
Created June 9, 2015 12:37
Apiary Routes
var mainFile = process.argv[2];
var fs = require('fs');
var route_regex = /\#.+\[\/(.+)\]/;
var method_regex = /\#*\s*(.+)\s*\[(\w+)\]/;
var file = fs.readFileSync(mainFile).toString().split("\n");
var url = "";
@brunodles
brunodles / Youtube_Id.regex
Last active April 24, 2024 07:30
This is a youtube regex to get video id
(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([\w\-_]+)\&?
@brunodles
brunodles / codeship_android_build.sh
Created October 31, 2015 01:56 — forked from PuKoren/codeship_android_build.sh
Codeship Android build script
cd /tmp
pwd
#Download Android SDK from Google and unzip it
wget http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz
tar zxvf android-sdk_r24.1.2-linux.tgz
rm android-sdk_r24.1.2-linux.tgz
#Set extracted SDK location to $PATH so we can use commands
export ANDROID_HOME="/tmp/android-sdk-linux"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
@brunodles
brunodles / gist:ca4c5fb485dcaf808291
Created February 3, 2016 12:33 — forked from emanuelet/gist:539e8cfe3d7c450c063d
Codeship Setup Commands for Android Gradle Build
wget http://dl.google.com/android/android-sdk_r24.3-linux.tgz
tar xvzf android-sdk_r24.3-linux.tgz
rm android-sdk_r24.3-linux.tgz
export ANDROID_HOME=$PWD/android-sdk-linux
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
echo "y" | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-22.0.1,android-22,extra-google-m2repository,extra-google-google_play_services,extra-android-support,139
cd -
touch local.properties
echo "sdk.dir=$ANDROID_HOME" >> local.properties
# ./gradlew clean
@brunodles
brunodles / strings_fonts.xml
Created March 2, 2016 11:56
Just a String res file to use autocompletation for fonts
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- This file is just to simplify the font usage.-->
<string name="sans_serif" translatable="false">sans-serif</string>
<string name="sans_serif_light" translatable="false">sans-serif-light</string>
<string name="sans_serif_thin" translatable="false">sans-serif-thin</string>
<string name="sans_serif_condensed" translatable="false">sans-serif-condensed</string>
<string name="sans_serif_medium" translatable="false">sans-serif-medium</string>
<string name="sans_serif_black" translatable="false">sans-serif-black</string>
@brunodles
brunodles / Stack.java
Created April 5, 2016 18:51
My history through Java Testing — Main Methods
import java.util.ArrayList;
import java.util.List;
public class Stack<T> {
private List<T> list = new ArrayList<>();
public boolean isEmpty() {
return list.isEmpty();
}
@brunodles
brunodles / gist:badaa6de2ad3a84138d517795f15efc7
Last active February 17, 2023 03:10
This is a test to show how to use expresso to check if a toast was displayed.
package com.github.brunodles.toastespresso;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@brunodles
brunodles / ApplicationTest.java
Last active April 5, 2016 21:35
This is a test to show how to use expresso to check if a toast was displayed.
package com.github.brunodles.toastespresso;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.jetbrains.spek.api.Spek
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNull
import kotlin.test.assertTrue
/**
* Created by bruno on 10/03/16.
*/
@brunodles
brunodles / ViewPagerAdapter.java
Created June 21, 2016 19:15
Base adapter for Views inside viewpager
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
public abstract class ViewPagerAdapter extends PagerAdapter {
@Override
public Object instantiateItem(ViewGroup container, int position) {