Skip to content

Instantly share code, notes, and snippets.

View gdequeiroz's full-sized avatar

Gabriela de Queiroz gdequeiroz

View GitHub Profile
@gdequeiroz
gdequeiroz / screenshot-paste-to-folder.sh
Last active July 26, 2023 21:25
Take a screenshot from one monitor using shortcuts on a Mac and then use the terminal to save it to a file
# Paste the clipboard contents (screenshot) and save it as a PNG image
pbpaste | screencapture -i screenshot.png

When trying to install pandas via pip, I got this:

zsh:1: command not found: pip

The work around was to do:

echo "alias python=/usr/bin/python3" >> ~/.zshrc

Source: https://stackoverflow.com/a/71621142

@gdequeiroz
gdequeiroz / forking.md
Created January 29, 2019 00:21
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@gdequeiroz
gdequeiroz / general-resources.md
Last active October 19, 2018 17:40
General Resources

How To - Upload and add Images to markdown files in Gist

Markdown files allow embedding images in it. However it requires the image to be hosted at some location and we can add the url of the image to embed it.

Example: ![Alternate image text](https://someurl/imagelocation/image.png)

We can use services like imgur or other services to host the images and use the hosted URL.

suppressPackageStartupMessages(library(selfscoRe))
## Fixed-field is our preferred file format
## Experian fields:
## First_Name
## Middle_Name
## Last_Name
## Addr1_Line1
## Addr1_Line2
#27 groups + new logo
library(leaflet)
Rlogo <- makeIcon(iconUrl = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4yLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA0MDAgNDAwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MDAgNDAwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDp1cmwoI1NWR0lEXzFfKTt9DQoJLnN0MXtmaWxsOnVybCgjU1ZHSURfMl8pO30NCjwvc3R5bGU+DQo8bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzFfIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9Ii00MzguMzQzNSIgeTE9IjYwMC40NTA2IiB4Mj0iLTQzNy44ODY2IiB5Mj0iNTk5Ljk5MzciIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoNzIxLjA5NCAwIDAgLTQ4Mi45MzcgMzE2MTIyLjE1NjMgMjkwMDQ5LjE1NjMpIj4NCgk8c3RvcCAgb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjojQ0FDRENGIi8+DQoJPHN0b3AgI
@gdequeiroz
gdequeiroz / json.py
Created September 15, 2015 01:14
pyspark
import json
json.loads(pclick_samples[0]).keys()
# Out[223]: [u'timestamp', u'logger', u'data', u'appVersion', u'level']
#
for i in pclick_samples[0:5]:
print json.loads(i)['data']['pclick']
# 0.00533626494896
# 0.00451090461716
# 0.00265758681441
# 0.00276519885403
@gdequeiroz
gdequeiroz / s3.r
Last active August 29, 2015 14:24 — forked from hadley/s3.r
library(httr)
library(digest)
library(XML)
s3_request <- function(verb, bucket, path = "/", query = NULL,
content = NULL, date = NULL) {
list(
verb = verb,
bucket = bucket,
path = path,
// in the spark shell here i load the file from S3
val myFile = sc.textFile("s3://some-s3-bucket/us-constitution.txt")
// Classic wordcount
val counts = myFile.flatMap(line => line.toLowerCase().replace(".", " ").replace(",", " ").split(" ")).map(word => (word, 1L)).reduceByKey(_ + _)
// create tuples for the words
val sorted_counts = counts.collect().sortBy(wc => -wc._2)
// print out a sample of 10 to see results