bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
import { curry, apply } from 'ramda'; | |
/** | |
* Debounce | |
* | |
* @param {Boolean} immediate If true run `fn` at the start of the timeout | |
* @param timeMs {Number} Debounce timeout | |
* @param fn {Function} Function to debounce | |
* | |
* @return {Number} timeout |
This is a quick tutorial explaining how to get a static website hosted on Heroku.
Why do this?
Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.
require 'rubygems' | |
require 'aws-sdk' | |
# This code snippet sends a push notification to a device using the Amazon SNS service. | |
# | |
# It is using the preview V2 amazon gem as per: | |
# https://aws.amazon.com/sdk-for-ruby/ | |
# | |
# This was installed using: | |
# $ gem install aws-sdk --pre |
#! /bin/bash | |
export RUN_AS='ubuntu'; | |
export INSTALL_DIR='/var/www/sentry'; | |
HOSTNAME='http://mysentry.example.com'; # No trailing slash | |
DB_HOST='something.rds.amazonaws.com'; | |
DB_PORT='5432'; | |
DB_USER='sentry'; | |
DB_NAME='sentry'; | |
DB_PASSWORD='DB_PASSWORD'; |
from functools import wraps | |
def juggle(f): | |
""" | |
Suppose we have a binary function | |
>>> def add(a, b): | |
... return a + b | |
You could call `it` in following way |
# The Nginx configuration based on https://coderwall.com/p/rlguog | |
http { | |
ssl_certificate server.crt; | |
ssl_certificate_key server.key; | |
ssl_session_timeout 15m; | |
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_session_cache shared:SSL:10m; |
#!/bin/bash | |
# | |
# This script backups an OS X system to an external volume, effectively | |
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for | |
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy | |
# Cloner. The latter website has an interesting list[5] on what files to | |
# exclude when cloning. | |
# | |
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt | |
# |