Skip to content

Instantly share code, notes, and snippets.

View arlm's full-sized avatar

Alexandre Rocha Lima e Marcondes arlm

View GitHub Profile
@arlm
arlm / Android-Studio.gitignore
Last active August 29, 2015 14:22 — forked from iainconnor/Android Studio .gitignore
Assorted .gitignore files
# Built application files
/**/build/
/**/gen/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
repo forall -pvc '
if git rev-parse android-4.0.3_r1 >/dev/null 2>&1
then
git log --oneline --no-merges android-4.0.3_r1..android-4.0.4_r1.1
else
git log --oneline --no-merges android-4.0.4_r1.1
fi
' | cat
# The Script
```sh
git log v2.1.0...v2.1.1 --pretty=format:'<li> <a href="http://github.com/jerel/<project>/commit/%H">view commit &bull;</a> %s</li> ' --reverse | grep "#changelog"
```
# A git alias for the command:
@arlm
arlm / explanation.md
Last active August 29, 2015 14:23 — forked from masak/explanation.md

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@arlm
arlm / mysqlbackup.sh
Last active October 15, 2015 21:03 — forked from nicdoye/mysqlbackup.sh
Backup your OpenShift MySQL database.My DB is only small so I didn't bother to compress it through a pipe. sftp it back from your local machine afterwards. This is basically a quick hack from running "type mysql" on the OpenShift gear - hint: it's a bash function/alias
#!/bin/sh
mkdir -p $OPENSHIFT_DATA_DIR/tmp/csv
chmod ugo+r $OPENSHIFT_DATA_DIR/tmp/csv
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --all-databases --single-transaction -r $OPENSHIFT_DATA_DIR/tmp/all-databases.sql
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --databases $OPENSHIFT_APP_NAME --single-transaction -r $OPENSHIFT_DATA_DIR/tmp/$OPENSHIFT_APP_NAME.sql
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --databases $OPENSHIFT_APP_NAME --single-transaction --routines=0 --triggers=0 --events=0 -r $OPENSHIFT_DATA_DIR/tmp/$OPENSHIFT_APP_NAME-no-procedures.sql
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} -
@arlm
arlm / elasticbeanstalk_deploy_iam_policy.md
Created October 21, 2015 19:22 — forked from RobertoSchneiders/elasticbeanstalk_deploy_iam_policy.md
IAM Policy for deploy on Elastic Beanstalk

I am deploying with this IAM using Codeship and Circle CI to Elastic Beanstalk. I had a lot of trouble with this config. I talked to the aws support for about 6 hours until this worked properly, so, I guess it is worth to share.

UPDATE: In the end, I have to use the AWSElasticBeanstalkFullAccess policy. My custom policy keep breaking every week with some new added permission or some EB internal change. Anyway, the IAM I was using is below.

This works for me with CircleCI and EB Cli.

{
    "Version": "2012-10-17",
    "Statement": [
        {
@arlm
arlm / submodule-pull.sh
Created October 28, 2015 19:16 — forked from stephenparish/submodule-pull.sh
Update submodules in a git repository to the latest, but exclude one..
git submodule foreach '[ "$path" == "submodule-to-exclude" ] || git pull origin master'
@arlm
arlm / gist:be4c1b9534831f381075
Created October 29, 2015 11:28 — forked from davidnunez/gist:1404789
list all installed packages in android adb shell
pm list packages -f
@arlm
arlm / iosStringSize.cs
Created May 21, 2016 12:18 — forked from ozzieperez/iosStringSize.cs
Xamarin IOS - Get the size of a string
//Method 1: No restrictions
((NSString)t.Text).GetSizeUsingAttributes(new UIStringAttributes {Font = t.Font});
//Method 2: Has to fit within a width
label.Frame = new CGRect(CGPoint.Empty, ((NSString)label.Text).GetBoundingRect(
new CGSize(width, nfloat.MaxValue),
NSStringDrawingOptions.UsesLineFragmentOrigin,
new UIStringAttributes { Font = label.Font},
null
).Size);