Skip to content

Instantly share code, notes, and snippets.

View arjones's full-sized avatar

Gustavo Arjones arjones

View GitHub Profile
@arjones
arjones / .gitignore
Created November 17, 2021 17:39
git ignore for Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python

Keybase proof

I hereby claim:

  • I am arjones on github.
  • I am arjones (https://keybase.io/arjones) on keybase.
  • I have a public key ASBDHWoyLH_i3BwGhA70T1QaKde0-8k1eIhJmqYK1MC4Ago

To claim this, I am signing this object:

@arjones
arjones / docker-install.sh
Last active May 29, 2017 23:03
Script to install docker + docker-compose
#!/usr/bin/env bash
# This script install DOCKER CE
DOCKER_VERSION=17.03.1~ce-0~ubuntu-$(lsb_release -cs)
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual \
apt-transport-https \
@arjones
arjones / notify-slack.sh
Last active September 9, 2023 22:20
Notify Slack - Send notifications to a Slack Channel - http://arjon.es/2016/09/15/be-notified-on-slack-when-a-long-process-finishes/
# Notify Slack - Send notifications to a Slack Channel
# Copyright (C) 2016 Gustavo Arjones (@arjones)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# Full blog post here: http://arjon.es/2016/09/15/be-notified-on-slack-when-a-long-process-finishes/
#
@arjones
arjones / logback.xml
Created June 15, 2016 14:02
Logback sample configuration with RollingFileAppender
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--Daily rolling file appender -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>logs/application.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>logs/application.%d{yyyy-MM-dd}.log.gz</FileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
@arjones
arjones / JsonParser.scala
Last active January 20, 2016 13:01
Scala Json Parser Example
import org.json.JSONObject
case class Item(id: String, category: String, soldQuantity: Integer, price: Double, currencyId: String,
sellerId: Long, officialStoreId: String, condition: String, acceptMP: Boolean)
object JsonParser {
def parseSearch(json: String): List[Item] = {
try {
#!/bin/bash
######
# Reduce the precision to 1 decimal point == 11Km
# Requires BC (shell calculator)
function geo_reduce {
local PRECISION=1
local LAT=$(echo "$1" | cut -d',' -f2)
local LON=$(echo "$1" | cut -d',' -f1)
//==================================================================
// SPARK INSTRUMENTATION
//==================================================================
import com.codahale.metrics.{MetricRegistry, Meter, Gauge}
import org.apache.spark.{SparkEnv, Accumulator}
import org.apache.spark.metrics.source.Source
import org.joda.time.DateTime
import scala.collection.mutable
@arjones
arjones / gist:8606453
Created January 24, 2014 21:07
.hiverc file
-- Load JSON Serde
add jar /home/haddop/lib/hive-serdes-1.1-SNAPSHOT.jar;
-- Print column names when stdout
set hive.cli.print.header=true;
-- Print current db at prompt hive (etl)>
set hive.cli.print.current.db=true;
-- Allow Hive to swith to Local Mode (without hadoop)
@arjones
arjones / README.md
Last active December 29, 2015 17:39 — forked from mbostock/.block

Click on any arc to zoom in. Click on the center circle to zoom out.

A sunburst is similar to a treemap, except it uses a radial layout. The root node of the tree is at the center, with leaves on the circumference. The area (or angle, depending on implementation) of each arc corresponds to its value. Sunburst design by John Stasko. Data courtesy Jeff Heer.