Skip to content

Instantly share code, notes, and snippets.

View joyoyoyoyoyo's full-sized avatar
🏴
living it up and busy supporting my community.

Angel Ortega (he/they) joyoyoyoyoyo

🏴
living it up and busy supporting my community.
View GitHub Profile
package sbt
package internal
package fix
import scalafix.v1._
import scala.meta._
class Sbt0_13BuildSyntax extends SyntacticRule("Sbt0_13BuildSyntax") {
override def fix(implicit doc: SyntacticDocument): Patch = {
doc.tree.collect {
@joyoyoyoyoyo
joyoyoyoyoyo / keybase.md
Created December 23, 2020 03:00
keybase.md

Keybase proof

I hereby claim:

  • I am joyoyoyoyoyo on github.
  • I am joyoyoyoyoyo (https://keybase.io/joyoyoyoyoyo) on keybase.
  • I have a public key ASCoqD60GikJ3VlSn2htUC7eD70XFWpZJdBKGFxfnEj0QAo

To claim this, I am signing this object:

@joyoyoyoyoyo
joyoyoyoyoyo / CityOfNewYork.scala
Created July 13, 2020 16:58
Programming Exercise from 2018 with Hart
/**
* Created by: Angel Ortega
* Date: 7/23/18
*/
import org.apache.spark.sql.{SaveMode, SparkSession}
import org.apache.spark.sql.functions.{count, max, sum}
object CityOfNewYorkChallenge extends App {
val spark = SparkSession.builder()
@joyoyoyoyoyo
joyoyoyoyoyo / MapReduceSolution.scala
Last active July 7, 2020 21:42
Programming exercise: Calculate the "poor ratio" for devices, "poor" is considered a device ping count which is lower than the device type's average ping. For devices marked as poor performance, calculate the ratio of devices considered poor. If the average ping count for an iPhone is 50, then any device below 50 would be considered poor, for ex…
package io.angelortega
import org.apache.spark.rdd.RDD
object MapReduceSolution extends LocalSparkContext {
def main(args: Array[String]): Unit = {
val inputRdd: RDD[String] = sc.textFile(args.head)
val deviceTypePoorRatios = calcPoorRatios(inputRdd)
@joyoyoyoyoyo
joyoyoyoyoyo / CustomIntFloatDict_IntFloatValueError.py
Created June 15, 2020 07:02 — forked from StephenFordham/CustomIntFloatDict_IntFloatValueError.py
CustomIntFloatDict and IntFloatValueError class code
# Create a dictionary that can only hold integers and floats as its values
class IntFloatValueError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return '{} is invalid input, CustomIntFloatDict can only accept ' \
'integers and floats as its values'.format(self.value)
@joyoyoyoyoyo
joyoyoyoyoyo / asyncio_ssl_example.py
Created May 31, 2020 08:30 — forked from messa/asyncio_ssl_example.py
Python asyncio + SSL TCP client/server example
#!/usr/bin/env python3
import asyncio
import multiprocessing
import os
import ssl
from time import sleep
port = 9000
@joyoyoyoyoyo
joyoyoyoyoyo / gist:c792918352e71586794150db7f349adc
Created May 23, 2020 08:24 — forked from mitchellh/gist:1277049
Configure Vagrant VM to use Host DNS for VPN
Vagrant::Config.run do |config|
# ...
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
@joyoyoyoyoyo
joyoyoyoyoyo / install.md
Created May 23, 2020 08:23 — forked from floehopper/install.md
Installing OSX Sierra from scratch

List & install software updates

softwareupdate --list
sudo softwareupdate --verbose --install --all

Set computer name

COMPUTER_NAME="<computer-name>"
sudo scutil --set ComputerName $COMPUTER_NAME
@joyoyoyoyoyo
joyoyoyoyoyo / install_linuxbrew_on_centos7.sh
Created May 23, 2020 04:49 — forked from warking/install_linuxbrew_on_centos7.sh
standalone linuxbrew setup script for CentOS 7
# Non-root account is recommended for this process
# centos-specific prepration
sudo yum -y update && sudo yum -y groupinstall 'Development Tools' && sudo yum -y install curl irb m4 ruby
# Sanitize the environment
PATH=~/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
unset LD_LIBRARY_PATH PKG_CONFIG_PATH
# install linuxbrew