Skip to content

Instantly share code, notes, and snippets.

@mloayzagahona
mloayzagahona / gist:d4bda6d6d74a45233292f3b42cb8198a
Created May 8, 2017 21:27 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@mloayzagahona
mloayzagahona / filter-flow-release-start-version
Created September 16, 2017 21:33 — forked from petervanderdoes/filter-flow-release-start-version
gitflow hooks and filters for WordPress theme development
#!/bin/sh
#
# Runs during git flow release start
#
# Positional arguments:
# $1 Version
#
# Return VERSION - When VERSION is returned empty gitflow
# will stop as the version is necessary
#
@mloayzagahona
mloayzagahona / cat.py
Created March 23, 2018 17:56 — forked from dimo414/cat.py
Fast File Concatenation in Python
'''
Tests different methods of concatenating files in Python.
'''
from __future__ import print_function
import json,os,shutil,subprocess
import util
def verify(file,expected):
count = 0
@mloayzagahona
mloayzagahona / README.md
Created April 6, 2018 17:27 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@mloayzagahona
mloayzagahona / .bash_profile
Created June 14, 2018 03:27 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@mloayzagahona
mloayzagahona / sam_streams.scala
Created September 19, 2018 20:01 — forked from adriaanm/sam_streams.scala
Playing with Java 8 Stream from Scala 2.11.5
// $ scala-2.11.5 -Xexperimental
// Original Java 8 version: http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples/
scala> import java.util.{Arrays, List, ArrayList}
scala> import java.util.stream.{Stream, IntStream}
// List<String> myList = Arrays.asList("a1", "a2", "b1", "c2", "c1");
scala> val myList = Arrays.asList("a1", "a2", "b1", "c2", "c1")
@mloayzagahona
mloayzagahona / register_schema.py
Created December 4, 2018 19:03 — forked from aseigneurin/register_schema.py
Register an Avro schema against the Confluent Schema Registry
import os
import sys
import requests
schema_registry_url = sys.argv[1]
topic = sys.argv[2]
schema_file = sys.argv[3]
aboslute_path_to_schema = os.path.join(os.getcwd(), schema_file)
/**
*
*/
package com.xyz.topology.netflow.beam;
import java.util.Properties;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DecoderFactory;
@mloayzagahona
mloayzagahona / Deserialization.scala
Created January 5, 2019 15:48 — forked from ramn/Deserialization.scala
Object serialization example in Scala
import java.io._
@SerialVersionUID(15L)
class Animal(name: String, age: Int) extends Serializable {
override def toString = s"Animal($name, $age)"
}
case class Person(name: String)
// or fork := true in sbt
@mloayzagahona
mloayzagahona / Immutable Data Types with Jackson and Lombok.md
Created February 7, 2019 15:56 — forked from eeichinger/ Immutable Data Types with Jackson and Lombok.md
Example tests and notes for making Jackson work with Lombok

Examples for getting Jackson and Lombok to work together to create immutable data types.

Demonstrates use of:

  • Nullable Types
  • Optional
  • immutable java.util.List
  • immutable array
  • validating custom types on instantiate/unmarshalling
  • use & customize Lombok-@Builder with Jackson