Skip to content

Instantly share code, notes, and snippets.

View vicenteg's full-sized avatar

Vince Gonzalez vicenteg

View GitHub Profile
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@samklr
samklr / spark-notebook.json
Last active November 2, 2016 16:38
Spark Notebook Marathon/DCOS
{
"id": "spark-notebook",
"cpus": 1.5,
"mem": 3500,
"instances": 1,
"container":{
"type" : "DOCKER",
"docker": {
#!/usr/bin/bash
export SHARK_HOME=/opt/mapr/shark/shark-0.9.0
export SPARK_HOME=/opt/mapr/spark/spark-0.9.1
export SCALA_HOME=/usr/share/java
export CLASSPATH
@jkreps
jkreps / benchmark-commands.txt
Last active June 17, 2024 03:54
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@mitchwongho
mitchwongho / Docker
Last active June 26, 2024 07:28
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@rlankenau
rlankenau / retrosheet_loadfunc.java
Created July 29, 2013 16:35
Pig LoadFunc for RetroSheet data.
@Override
public InputFormat getInputFormat() throws IOException {
return new RetrosheetInputFormat();
}
@Override
public Tuple getNext() throws IOException {
RetrosheetPlayer[] home_players = new RetrosheetPlayer[11];
RetrosheetPlayer[] away_players = new RetrosheetPlayer[11];
RetrosheetPlayer[] defense = null;
@ept
ept / gist:4475995
Last active November 4, 2022 08:38
Syntax highlighting code for PowerPoint (Mac OS)

How to add syntax-highlighted code to PowerPoint slides (Mac OS)

  1. pygmentize -f rtf FILE | pbcopy
  2. Paste into TextEdit (in rich text mode: Format → Make Rich Text before pasting), and copy to clipboard again.
  3. In PowerPoint, Edit → Paste Special… → Styled Text.

(Pasting RTF directly into PowerPoint doesn't work correctly, at least with PowerPoint 2008 — it extends colour spans longer than it should, and sometimes removes line breaks. Going via TextEdit seems to solve the problem.)

@jordelver
jordelver / gist:3073101
Created July 8, 2012 22:06
Set the Mac OS X SOCKS proxy on the command line

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

@merwok
merwok / gist:2636213
Created May 8, 2012 15:20
ReplicaSetConnection for mongokit
import pymongo
from mongokit.database import Database
# code copied and adapted from mongokit (3-clause BSD license)
class CallableMixin(object):
"""
brings the callable method to a Document. usefull for the connection's
register method
"""
@entaroadun
entaroadun / gist:1653794
Created January 21, 2012 20:10
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation: