Skip to content

Instantly share code, notes, and snippets.

View pablete's full-sized avatar

Pablo A. Delgado pablete

View GitHub Profile
@pablete
pablete / gist:dffe1716564e0bc726229814b9fa6c55
Created October 20, 2021 20:58 — forked from Frozenfire92/gist:3627e38dc47ca581d6d024c14c1cf4a9
Install Scala and SBT using apt-get on Ubuntu 16.04 or any Debian derivative using apt-get
## Java
sudo apt-get update
sudo apt-get install default-jdk
## Scala
sudo apt-get remove scala-library scala
sudo wget http://scala-lang.org/files/archive/scala-2.12.1.deb
sudo dpkg -i scala-2.12.1.deb
sudo apt-get update
sudo apt-get install scala
@pablete
pablete / jupyter_config.py
Created February 23, 2021 22:20
no hassle jupyter config
c.NotebookApp.allow_root = True
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.token = ''
@pablete
pablete / Gemfile
Created June 25, 2020 21:43 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@pablete
pablete / xgb_tb.py
Created October 31, 2018 23:03 — forked from tsu-nera/xgb_tb.py
xgboost visualization with tensorboard
from sklearn.datasets import load_boston
import pandas as pd
import xgboost as xgb
from tensorboard_logger import configure, log_value
from sklearn.cross_validation import train_test_split
def logspy(env):
log_value("train", env.evaluation_result_list[0][1], step=env.iteration)

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@pablete
pablete / akka-http-client.scala
Created September 8, 2017 07:26 — forked from dcaoyuan/akka-http-client.scala
akka-http-client-example
val uri = "http://www.yahoo.com"
val reqEntity = Array[Byte]()
val respEntity = for {
request <- Marshal(reqEntity).to[RequestEntity]
response <- Http().singleRequest(HttpRequest(method = HttpMethods.POST, uri = uri, entity = request))
entity <- Unmarshal(response.entity).to[ByteString]
} yield entity
val payload = respEntity.andThen {
@pablete
pablete / nodes.edn
Last active September 5, 2017 18:44
:spark-submit-options [
"--conf" "spark.driver.maxResultSize=10G"
"--conf" "spark.cores.max=150"
"--conf" "spark.driver.cores=2"
"--conf" "spark.driver.memory=24G"
"--conf" "spark.executor.cores=2"
"--conf" "spark.executor.memory=24G"
"--conf" "spark.scheduler.minRegisteredResourcesRatio=1.0"
"--conf" "spark.scheduler.maxRegisteredResourcesWaitingTime=1200"
"--conf" "spark.mesos.role=pvr"
@pablete
pablete / step.scala
Last active September 5, 2017 18:44
BDASSpark("com.netflix.simulation.terasort.TeraGen",
None,
List("$sortSize", "20", "/terasort/IN"),
Some("2.0"),
List(
("--conf", "spark.driver.cores=2"),
("--conf", "spark.driver.memory=24G"),
("--conf", "spark.executor.cores=2"),
("--conf", "spark.executor.memory=24G"),
("--conf", "spark.cores.max=40"),
@pablete
pablete / README.md
Last active March 23, 2017 00:59
Sample embedding visualization with tensorboard

Execute

shell> python mnist_tsne.py

Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes.
Extracting ./data/train-images-idx3-ubyte.gz
Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes.
Extracting ./data/train-labels-idx1-ubyte.gz
Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes.

Extracting ./data/t10k-images-idx3-ubyte.gz

def time[R](block: => R): R = {
val t0 = System.currentTimeMillis
val result = block // call-by-name
val t1 = System.currentTimeMillis
println("Elapsed time: " + (t1 - t0) + "ms")
result
}