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 / git-update-upstream
Last active January 25, 2022 10:21
Git custom commands
#!/bin/bash
# Remember to put the script directory on path
git fetch upstream develop
git rebase upstream/develop
@annacruz
annacruz / iterm_preferences.itermkeymap
Created February 23, 2021 09:51
Iterm configuration
{"Key Mappings":{"0xf700-0x260000":{"Text":"[1;6A","Action":10},"0x37-0x40000":{"Text":"0x1f","Action":11},"0x32-0x40000":{"Text":"0x00","Action":11},"0xf709-0x20000":{"Text":"[17;2~","Action":10},"0xf70c-0x20000":{"Text":"[20;2~","Action":10},"0xf729-0x20000":{"Text":"[1;2H","Action":10},"0xf72b-0x40000":{"Text":"[1;5F","Action":10},"0xf705-0x20000":{"Text":"[1;2Q","Action":10},"0xf703-0x260000":{"Text":"[1;6C","Action":10},"0xf700-0x220000":{"Text":"[1;2A","Action":10},"0xf703-0x300000":{"Text":"[4~","Action":10},"0xf701-0x280000":{"Text":"0x1b 0x1b 0x5b 0x42","Action":11},"0x38-0x40000":{"Text":"0x7f","Action":11},"0x33-0x40000":{"Text":"0x1b","Action":11},"0xf703-0x220000":{"Text":"[1;2C","Action":10},"0xf701-0x240000":{"Text":"[1;5B","Action":10},"0xf70d-0x20000":{"Text":"[21;2~","Action":10},"0xf702-0x260000":{"Text":"[1;6D","Action":10},"0xf729-0x40000":{"Text":"[1;5H","Action":10},"0xf702-0x300000":{"Text":"[1~","Action":10},"0xf706-0x20000":{"Text":"[1;2R","Action":10},"0x34-0x40000":{"Text":"0x1c","
@annacruz
annacruz / Installing_capybara_webkit.md
Last active March 20, 2023 07:28
Steps to install capybara-webkit with qtwebkit on mac
  • Install Xcode
  • Accept the xcode license with sudo xcodebuild -license
  • Install qt from: https://download.qt.io/new_archive/qt/5.5/5.5.0/
  • Add the following line in .bashrc or .zshrc or whatever -> export PATH="$HOME/Qt5.5.0/5.5/clang_64/bin/:$PATH"
  • Reload the terminal or source .zshrc
  • Go to the directory /Applications/Xcode.app/Contents/Developer/usr/bin/
  • Make the symlink: ln -s xcodebuild xcrun
  • Install the lib with gem install capybara-webkit

If any problem accepting the license occurs, here are one solution to it:

#!/usr/bin/env ruby
# put this in the file .git/hooks/pre-commit
require "shellwords"
puts `git status --porcelain`
puts "Running Rubocop from #{__FILE__}"
changed = `git status --porcelain`.
split("\n").
#! /usr/bin/env ruby
require 'json'
require 'date'
file = File.open(ARGV[0])
file_data = file.read
timesheet = JSON.parse(file_data)
with_converted_data = []
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: Home(),
));
}
class Home extends StatefulWidget {
@override
void main() {
criarBotao("BotaoSair", cor: "Preto", largura: 15.0);
}
void criarBotao(String texto, {String cor, double largura}) {
print(texto);
print(cor);
print(largura);
}
context "valid attributes" do
before(:each) do
type = create(:type)
spok = create(:user, name: 'Spok')
kirk = create(:user, name: 'Commander Kirk')
task.type = type
do_action({name: "New Project name", status_id: status.id, type_id: type.id, watcher_ids: [spok.id]})
end
@annacruz
annacruz / crypto_glossary.md
Last active February 6, 2018 07:09
This is an simple cryptography glossary based on some articles I read.

AKE -> Authenticated Key Exchange
DAKE -> Deniable Authenticated Key Exchange
OTR -> Off-The-Record
3DH -> Triple Diffie-Hellman
X3DH -> Extended Triple Diffie-Hellman
KCI -> Key Compromise Impersonation
DAKEZ -> DAKE with Zero-knowledge
ZDH -> Zero-knowledge Diffie-Hellman
XZDH -> Extended Zero-knowledge Diffie-Hellman
ROM -> Random Oracle Model

const puppeteer = require('puppeteer');
let scrape = async () => {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
await page.goto('http://www.tesouro.gov.br/pt/-/rentabilidade-acumulada')
await page.waitFor(100);
const result = await page.evaluate(() => {
page.click('button[value="Baixar arquivo"]')