Skip to content

Instantly share code, notes, and snippets.

@lopespm
lopespm / .gitignore
Created January 31, 2015 22:23
Unity 3D .gitignore
*.DS_Store
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
#Un-ignore these specific files
!/Library/*.asset
!/Library/AssetImportState
@lopespm
lopespm / gist:7411599
Last active December 28, 2015 00:09 — forked from gcatlin/gist:1847248
# Original Gist by gcatlin/gist:1847248
#
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew unlink FORMULA
brew install FORMULA
git checkout -- Library/Formula/FORMULA.rb # reset formula
@lopespm
lopespm / bootlocal.sh
Last active June 20, 2016 16:11
Docker - mount other folder other than /Users in osx
# from https://github.com/docker/machine/issues/1826#issuecomment-143863060
#if using boot2docker
#create file bootlocal.sh inside /var/lib/boot2docker; so it will persist and get executing when boot2docker images runs
##if target folder not present; create one
mkdir [target folder]
##mount the hostfolder; it should be shared with virtualbox already
##[hostfolder] is the folder name you gave when sharing the folder, not the path
sudo mount -t vboxsf -o uid=1000,gid=1000 [hostfolder] [target folder]
@lopespm
lopespm / libre_office_tableau20_palette.soc
Last active August 27, 2016 17:21
Libre Office Tableau 20 color palette, which you can use in Libre Draw for example - colors extracted from http://tableaufriction.blogspot.pt/2012/11/finally-you-can-use-tableau-data-colors.html
<?xml version="1.0" encoding="UTF-8"?>
<ooo:color-table xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ooo="http://openoffice.org/2004/office">
<draw:color draw:name="tb01" draw:color="#1f77b4"/>
<draw:color draw:name="tb02" draw:color="#aec7e8"/>
<draw:color draw:name="tb03" draw:color="#ff7f0e"/>
<draw:color draw:name="tb04" draw:color="#ffbb78"/>
<draw:color draw:name="tb05" draw:color="#2ca02c"/>
<draw:color draw:name="tb06" draw:color="#98df8a"/>
<draw:color draw:name="tb07" draw:color="#d62728"/>
<draw:color draw:name="tb08" draw:color="#ff9896"/>
@lopespm
lopespm / print_where_path_is_defined.sh
Created February 16, 2016 01:43
Print out of where your OSX Terminal bash $PATH is being defined
#!/bin/bash
# Simple script to print out where your PATH variable is getting defined on for your OSX bash Terminal
#
echo -e "------------------------------------------------"
echo -e "------- ~/.bash_profile -------"
echo -e "------------------------------------------------"
cat ~/.bash_profile | grep PATH=
echo -e ""
@lopespm
lopespm / do_action_for_every_device.sh
Last active December 28, 2016 00:29
Do ADB action for every connected android device
#!/bin/bash
# In this case, it is installing an apk for every connected device, but could be any other ADB action
adb devices | awk 'FNR>1 {print $1}'| while read line ; do adb -s $line install the-app.apk ; done
@lopespm
lopespm / EnumerableMidRange.cs
Last active May 30, 2017 21:32
MidRange Enumerable Extension (C# LINQ)
using System.Collections.Generic;
using System.Linq;
static class EnumerableExtensions
{
/// <summary>
/// Calculate the enumerable's mid-range https://en.wikipedia.org/wiki/Mid-range
/// </summary>
public static float MidRange(this IEnumerable<float> source)
{
@lopespm
lopespm / useful_android_adb_commands.txt
Created December 1, 2017 17:45
Useful android ADB commands
# Show Tasks
adb shell dumpsys activity activities | sed -En -e '/Stack #/p' -e '/Running activities/,/Run #0/p'
@lopespm
lopespm / gist:9dd2639be43ec61e8f452f9cbae131cd
Created February 14, 2018 22:45
Use openSSL to verify a server's certificate
# In OSX, export all your root certicates through Keychain to "Certificates.pem" (for example)
openssl s_client -CAfile Certificates.pem -connect learnbreak.com:443 -servername learnbreak.com | openssl x509 -noout -subject -issuer
@lopespm
lopespm / userChrome.css
Last active September 19, 2018 00:40
Custom Firefox userChrome.css for dark private tabs when using light theme
/* How to Create a userChrome.css File: https://www.userchrome.org/how-create-userchrome-css.html */
/* Dark background color for private browsing tabs, with corresponding lighter text color */
#main-window[privatebrowsingmode="temporary"] #tabbrowser-tabs {
/*--tab-line-color: #8000d7 !important;*/
background-color: #000000 !important;
color: #ffffff !important;
}