Skip to content

Instantly share code, notes, and snippets.

View dblooman's full-sized avatar

David Blooman dblooman

View GitHub Profile
#!/usr/bin/env ruby
require 'csv'
require 'json'
if ARGV.size != 2
puts 'Usage: csv_to_json input_file.csv output_file.json'
puts 'This script uses the first line of the csv file as the keys for the JSON properties of the objects'
exit(1)
end
@snatchev
snatchev / SafariApnController.rb
Last active December 30, 2015 20:39
An example Ruby implementation using ZeroPush to send Safari Push Notifications
class SafariApnController < ApplicationController
# When a user allows permission to receive push notifications, a POST request is sent to the following URL:
# webServiceURL/version/pushPackages/websitePushID
# post '/:version/pushPackages/:website_push_id' => 'safari_apn#package'
def package
#return the push package
send_file(File.join(Rails.root, 'public', 'pushPackage.zip'), type: 'application/zip', disposition: 'inline')
end
@dongjinleekr
dongjinleekr / consumer.sh
Last active August 5, 2024 08:44
Kafka benchmark commands
## Consumer Throughput: Single consumer thread, no compression
## Consumer Throughput: 3 consumer thread, no compression
bin/kafka-consumer-perf-test.sh --topic benchmark-3-3-none \
--zookeeper kafka-zk-1:2181,kafka-zk-2:2181,kafka-zk-3:2181 \
--messages 15000000 \
--threads 1
@ueokande
ueokande / benchmark-commands.md
Last active November 6, 2024 19:48 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands

Benchmark commands

Producer

Setup

bin/kafka-topics.sh \
  --zookeeper zookeeper.example.com:2181 \
  --create \
@tj
tj / snippets.coffee
Last active September 1, 2018 19:01
Atom snippets for Go
'.source.go':
'Options':
'prefix': 'options'
'body': '''
// Option function.
type Option func(*$1)
// New with the given options.
func New(options ...Option) *$1 {