Skip to content

Instantly share code, notes, and snippets.

View mingzhou's full-sized avatar
🎯
Focusing

Mingzhou ZHUANG mingzhou

🎯
Focusing
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@benjchristensen
benjchristensen / FuturesB.java
Last active December 12, 2023 09:36
FuturesB.java Example of using Futures for nested calls showing how it blocks inefficiently.
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@ashrithr
ashrithr / kafka.md
Last active March 14, 2024 21:16
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@widged
widged / d3lib.md
Created October 4, 2013 03:29
d3 libraries

chartFactory

/affini-tech/ChartFactory

Based on D3.JS and Dimple, ChartFactory provide the ability to build quickly D3.JS charts without coding any lines of javascript. Just define your dashboard in a JSON and voila !

charts: [
        {id:'chart1',
         width:800,height:250,

xAxis:{type:'Category',field: "Month",orderRule:'Date'},

@agramfort
agramfort / lasso_lars.py
Created October 30, 2013 08:28
Lasso LARS with positivity
"""
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
# Author: Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux
#
# License: BSD Style.
@cvogt
cvogt / gist:9193220
Last active February 13, 2022 13:50 — forked from ruescasd/gist:7911033
Slick: Dynamic query conditions using the **MaybeFilter** (Updated to support nullable columns)
import scala.slick.lifted.CanBeQueryCondition
// optionally filter on a column with a supplied predicate
case class MaybeFilter[X, Y](val query: scala.slick.lifted.Query[X, Y]) {
def filter[T,R:CanBeQueryCondition](data: Option[T])(f: T => X => R) = {
data.map(v => MaybeFilter(query.filter(f(v)))).getOrElse(this)
}
}
// example use case
import java.sql.Date
@staltz
staltz / introrx.md
Last active July 26, 2024 04:24
The introduction to Reactive Programming you've been missing
name := "playground"
version := "1.0"
scalaVersion := "2.10.4"
libraryDependencies += "org.apache.spark" %% "spark-core" % "1.1.0"
libraryDependencies += "net.sf.opencsv" % "opencsv" % "2.3"
@benjamin-smith
benjamin-smith / elasticsearch-local-development-with-docker-osx.md
Last active October 19, 2021 08:01
Develop locally with Elasticsearch on OSX using Docker

Develop locally with Elasticsearch on OSX using Docker

Docker

Docker does not run natively on OSX, only Linux. Docker Machine was created to add a Linux VM environment to run Docker containers on OSX. Install using Homebrew:

brew install docker
brew install docker-machine
docker-machine create
@luijar
luijar / ch01-magic-run.js
Last active June 2, 2024 12:33
Functional Programming in JavaScript Chapter 01 - run function
/*
* Functional Programming in JavaScript
* Chapter 01
* Magical -run- function in support of Listing 1.1
* Author: Luis Atencio
*/
// -run- with two functions
var run2 = function(f, g) {
return function(x) {
return f(g(x));