Skip to content

Instantly share code, notes, and snippets.

View annacruz's full-sized avatar
🏠
Working from home

Anna Cruz annacruz

🏠
Working from home
View GitHub Profile
@annacruz
annacruz / fish_shell_tips.md
Created December 5, 2017 11:05
Just some tips about fish shell

When compiling a C/C++ file with gcc using external libs:

gcc (pkg-config --cflags --libs <libs_you_wanna_load> | tr -s ' ' '\n') -o example-1 example-1.c
@annacruz
annacruz / tmux-cheat-sheet.md
Last active March 9, 2021 14:07
This is a small cheatsheet about tmux to remember the commands

Opening tmux

  • Starting new named session

tmux new -s <name-of-session>

  • Attach to named session

tmux a -t <name-of-session>

@annacruz
annacruz / irc-command.md
Created November 21, 2017 13:19
Some useful irc commands

Remove "Ghost" User

/msg nickserv ghost

/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in
* IE on Windows Phone and in iOS.
*/
@annacruz
annacruz / servless.md
Last active September 22, 2017 00:24
Talk about servless. Microservices meetup at ThoughtWorks NYC. Thursday Sept 21 2017

Servless!

@mikebroberts - Symphonia

  • Next level of cloud computing
  • First stage: Starts with amazon ec2 (IaaS)
  • Second stage: Heroku (PaaS)
  • Third stage: Docker - Kubernetes (CaaS - Cloud as a Service)
  • Today(?!?): Serverless! - Outsource information for other vendors

Backend as a Service (BaaS)

@annacruz
annacruz / kill_process_listen_to_port.sh
Created September 19, 2017 21:50
This small script kills the process which is listening to some port blocking some other thing to run properly
lsof -i $1 | awk 'FNR == 2 {print $2};' | xargs kill -9
@annacruz
annacruz / git_cool_commands.md
Last active April 10, 2018 00:34
Some cool git commands to keep in mind
git stash -u

Stash files included the untracked ones

git log --full-history --all -- <path-to-file>

git log -u <path-to-file>
@annacruz
annacruz / PWA_e_Vuejs.MD
Created August 25, 2017 14:24
Palestras da BrazilJS

PWA e Vuejs - milenevlacerda

PWA

  • Push notifications
  • Instalável
  • Atualização automática

Para funcionar: Service Worker

  • Serviço que roda no browser
  • Em geral entre a requisiço e a resposta e funciona
(ns forca.core
(:gen-class))
(def total-de-vidas 6)
(defn perdeu [] (print "Voce perdeu"))
(defn ganhou [] (print "Voce ganhou"))
(defn letras-faltantes [palavra acertos]
(remove (fn [letra] (contains? acertos (str letra))) palavra)
@annacruz
annacruz / parser.py
Created May 30, 2017 17:25
Parsing csv files with tab delimiter to JSON
import csv
import json
csvfile = open('file1.csv', 'r')
jsonfile = open('file2.json', 'w')
fieldnames = ("firstname", "lastname", "phone", "birthdate")
reader = csv.DictReader( csvfile, fieldnames, delimiter='\t')
for row in reader: