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 / .gitignore
Created June 2, 2016 11:58 — forked from chuckdee68/.gitignore
Default Visual Studio .gitignore
# git ignore file
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
@arlm
arlm / install-vsix-appveyor.ps1
Created May 28, 2016 00:58 — forked from FeodorFitsner/install-vsix-appveyor.ps1
Installing VSIX extension from command line
$vsixPath = "$($env:USERPROFILE)\sqlite-wp81-winrt-3081002.vsix"
(New-Object Net.WebClient).DownloadFile('https://visualstudiogallery.msdn.microsoft.com/5d97faf6-39e3-4048-a0bc-adde2af75d1b/file/132406/15/sqlite-wp81-winrt-3081002.vsix', $vsixPath)
"`"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\VSIXInstaller.exe`" /q /a $vsixPath" | out-file ".\install-vsix.cmd" -Encoding ASCII
& .\install-vsix.cmd
@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);
@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 / 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 / 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 / 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 / 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.

# 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: