Skip to content

Instantly share code, notes, and snippets.

View murielsilveira's full-sized avatar

Muriel Silveira murielsilveira

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="style.css">
<title>Draggable</title>
</head>
@murielsilveira
murielsilveira / .zshrc
Last active October 5, 2015 21:23 — forked from SlexAxton/.zshrc
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
import sys
import argparse
from getpass import getpass
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def navigate(card_number, user_name, passkey):
try:
browser = webdriver.Firefox()

Dev List Bookmarks

Attention: the list was moved to https://github.com/vitorbritto/dev-list

This page is not maintained anymore, please update your bookmarks.


Recently, I decided to organize my bookmarks. So, like a good fellow, I am sharing with you. I hope you enjoy!

#$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
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())

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.
@murielsilveira
murielsilveira / latency.markdown
Created May 15, 2019 23:40 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

Desafio Técnico-Elixir

Precisamos de pessoas com energia, integridade e inteligência, que aprendam rápido e que gostem de conhecer e aplicar novas tecnologias.

O tempo sugerido para conclusão do desafio é de 15 dias. Queremos que você se dedique e demonstre a qualidade de seu código.

Bom desafio!

O Desafio

O Sistema Financeiro precisa representar valores monetários. A ideia básica é ter uma estrutura de dados que permita realizar operações financeiras com dinheiro dentro de uma mesma moeda. Isso é pelo motivo de pontos flutuantes terem problemas de aritmética, logo encodificamos valores decimais/fracionais/reais como uma estrutura de dados com campos em inteiros, além de mapeamos operações aritméticas sobre tal estrutura. No fim, a implementação acaba sendo uma Estrutura de Dados Abstrata.