Skip to content

Instantly share code, notes, and snippets.

View murielsilveira's full-sized avatar

Muriel Silveira murielsilveira

View GitHub Profile
#$AndroidToolPath = "${env:ProgramFiles(x86)}\Android\android-sdk\tools\android"
$AndroidToolPath = "$env:localappdata\Android\android-sdk\tools\android"
Function Get-AndroidSDKs() {
$output = & $AndroidToolPath list sdk --all
$sdks = $output |% {
if ($_ -match '(?<index>\d+)- (?<sdk>.+), revision (?<revision>[\d\.]+)') {
$sdk = New-Object PSObject
Add-Member -InputObject $sdk -MemberType NoteProperty -Name Index -Value $Matches.index
Add-Member -InputObject $sdk -MemberType NoteProperty -Name Name -Value $Matches.sdk
@murielsilveira
murielsilveira / gif.md
Last active February 29, 2016 20:10
Create gifs of a screen capture (mac)

Create gifs

	Dependency: brew install ffmpeg

	1. Record a video with Quicktime (File > New screen recording)
	2. ffmpeg -i path-to-the-video.mov -pix_fmt rgb24 -r 10 output.gif
@murielsilveira
murielsilveira / github-diff-with-whitespace-ignored.js
Last active March 10, 2016 19:29
GitHub diff with whitespace ignored
javascript:(function(){
if (document.location.host === 'github.com') {
var query = document.location.search;
if (query === '') {
document.location = document.location + '?w=1';
} else if (query.indexOf('w=') === -1){
document.location = document.location + '&w=1';
} else {
var index = query.indexOf('w=');
var arr = query.substr(index).split('&');
pip install awscli
aws s3 rm s3://<bucket-name> --recursive
aws s3 sync dist s3://<bucket-name> --acl public-read --cache-control "public, max-age=86400"
aws s3 cp dist/index.html s3://<bucket-name>/index.html --acl public-read --cache-control "public, max-age=60"
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())
### Keybase proof
I hereby claim:
* I am murielsilveira on github.
* I am murielsilveira (https://keybase.io/murielsilveira) on keybase.
* I have a public key ASA5H-rnxJedCPmv8C_ppYCqZhZrifo3KRGnmadC2IMuYAo
To claim this, I am signing this object:
# tmux tips
- https://gist.github.com/MohamedAlaa/2961058
- https://github.com/tmux-plugins/tpm
- https://github.com/tmux-plugins/tmux-resurrect
- https://github.com/tmux-plugins/tmux-continuum
- https://www.sitepoint.com/10-killer-tmux-tips/

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

How to Win Friends and Influence People

Fundamental Techniques in Handling People

  1. Don't criticize, condemn, or complain.
  2. Give honest and sincere appreciation.
  3. Arouse in the other person an eager want.
  4. Never show others that you are not interested in what they have to say.