Skip to content

Instantly share code, notes, and snippets.

View tovbinm's full-sized avatar
⌨️
<typing sounds>

Matthew Tovbin tovbinm

⌨️
<typing sounds>
View GitHub Profile
@DmitrySoshnikov
DmitrySoshnikov / dfs-bfs-non-recursive.js
Created October 19, 2015 05:40
Non-recursive DFS and BFS algorithms
/**
* Depth-first and Breadth-first graph traversals.
*
* In this diff we implement non-recursive algorithms for DFS,
* and BFS maintaining an explicit stack and a queue.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style license
*/
@cb372
cb372 / jargon.md
Last active May 8, 2023 16:03
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

import java.nio.charset.Charset
import java.text.SimpleDateFormat
import java.util.Date
import com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient
import com.amazonaws.services.elasticbeanstalk.model.{UpdateEnvironmentRequest, S3Location, CreateApplicationVersionRequest}
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.services.s3.model.Region
import com.typesafe.sbt.packager.docker.DockerPlugin
import com.typesafe.sbt.packager.docker.DockerPlugin.autoImport.{Docker, dockerExposedPorts}
@gubatron
gubatron / compiling_building_c_cpp_notes.md
Last active April 18, 2024 07:58
Things to remember when compiling and linking C/C++ programs

Things to remember when compiling/linking C/C++ software

by Angel Leon. March 17, 2015;

Last update on December 14, 2023

Updated on February 27, 2023

Updated August 29, 2019.

@JeroMiya
JeroMiya / Scala Activity
Created July 19, 2014 03:14
Android Studio Scala Gradle config
package com.example.jeremybell.myapplication
import android.app.Activity
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
class MyActivity extends Activity {
override def onCreate(savedInstanceState: Bundle): Unit = {
super.onCreate(savedInstanceState)
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@julianpeeters
julianpeeters / spark-avro-reading-noIDL
Last active February 8, 2021 17:05
read avros in spark without an IDL with GenericRecord
//Adapted from: https://github.com/jcrobak/avro-examples
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.avro.generic.GenericRecord
import org.apache.avro.mapred.AvroKey
import org.apache.avro.mapreduce.AvroKeyInputFormat
import org.apache.hadoop.io.NullWritable
import org.apache.commons.lang.StringEscapeUtils.escapeCsv
@bbeaudreault
bbeaudreault / HBaseMapReduceUtils.java
Last active November 8, 2017 06:28
Control # of mappers per RegionServer
package org.apache.hadoop.hbase.mapreduce;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.mapreduce.Job;
@mletterle
mletterle / gist:8048086
Last active November 26, 2021 08:56
Replay Two Git Repositories History Into A New One, Chronologically

Combining Two (or more potentially) Git Repos

###Moving one repo into a subdirectory of the other

Preserves notes and sets commit details to author details

in newrepo

@ilguzin
ilguzin / Boot.scala
Created November 12, 2013 06:39
Turn on ssl support in spray
import spray.routing._
import spray.routing.directives.LogEntry
import spray.http.HttpRequest
import spray.httpx.encoding.{Gzip, NoEncoding}
import akka.event.Logging._
/** Main class to start up the application */
object Boot extends App with SimpleRoutingApp {