Skip to content

Instantly share code, notes, and snippets.

View jdevoo's full-sized avatar

JP de Vooght jdevoo

View GitHub Profile
@sahilsk
sahilsk / taskrunner.conf
Last active October 17, 2016 15:32
TaskRunner upstart script. aws, data pipeline, taskrunner
author "Sonu Kr. Meena"
description "upstart script for AWS Data Pipeline Task Runner"
start on runlevel [2345]
stop on runlevel [!2345]
# respawn the job up to 5 times within a 10 second period.
# If the job exceeds these values, it will be stopped and
# marked as failed.
respawn
@hkskoglund
hkskoglund / checkbattery
Last active December 26, 2020 23:09
bluetooth battery service uuid 0x2A19 polling with gatttool
#!/usr/bin/bash
# prints in CSV format for import into visualization tools
hextodec ()
{
hci_test_device_batterylevel=$((16#$1))
}
if [ -z "$1" ]
@staltz
staltz / introrx.md
Last active June 12, 2024 14:28
The introduction to Reactive Programming you've been missing
@jkreps
jkreps / benchmark-commands.txt
Last active January 21, 2024 11:02
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
@jbub
jbub / squash-commits.sh
Created June 12, 2013 15:31
git squash last two commits into one
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
@ashelly
ashelly / mediator.c
Created May 28, 2013 20:36
Running Median. Finds the median of the last K inputs in O(lg K). See http://stackoverflow.com/q/5527437/10396 for some details.
//Copyright (c) 2011 ashelly.myopenid.com under <http://www.opensource.org/licenses/mit-license>
#include <stdlib.h>
//Customize for your data Item type
typedef int Item;
#define ItemLess(a,b) ((a)<(b))
#define ItemMean(a,b) (((a)+(b))/2)
typedef struct Mediator_t
@seandenigris
seandenigris / gist:4242432
Created December 8, 2012 23:01
Pharo Smalltalk TCP Server
"Adapted from http://www.slideshare.net/nourybouraqadi/pharo-networking-by-example
$! denotes the end of a message
"
| connectionSock interactSock request stream |
connectionSock := Socket newTCP.
[
connectionSock listenOn: 8888 backlogSize: 10.
interactSock := connectionSock waitForAcceptFor: 15.
stream := SocketStream on: interactSock.
@awidegreen
awidegreen / vim_cheatsheet.md
Last active June 12, 2024 18:33
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@alexalemi
alexalemi / welford.py
Created March 21, 2012 19:29
Python Welford Algorithm
import math
class Welford(object):
""" Implements Welford's algorithm for computing a running mean
and standard deviation as described at:
http://www.johndcook.com/standard_deviation.html
can take single values or iterables
Properties:
mean - returns the mean