Skip to content

Instantly share code, notes, and snippets.

@ueokande
ueokande / benchmark-commands.md
Last active February 7, 2025 07:46 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands

Benchmark commands

Producer

Setup

bin/kafka-topics.sh \
  --zookeeper zookeeper.example.com:2181 \
  --create \
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@sinpaout
sinpaout / auto-rsync.js
Last active March 25, 2019 15:37
auto rsync with gulp task over ssh
// gulpfile.js
var gulp = require( 'gulp' );
var rsync = require( 'gulp-rsync' );
var rsyncHost = process.env.RSYNC_HOST || '0.0.0.0';
var rsyncPort = process.env.RSYNC_PORT || 22;
gulp.task( 'watch', function() {
var targets = [
'./js/**'
@Sanyambansal76
Sanyambansal76 / Django Access the Request or User Object Inside the Models and Signals.txt
Last active May 3, 2018 02:50
Django Access the Request or User Object Inside the Models and Signals.
#Access Request Object Inside the Models and Signals
#Create a middleware.py inside any app for example :- blog
#middleware.py
import threading
class RequestMiddleware(object):
thread_local = threading.local()
<?php
/**
* This plugin creates a new paragraph entity based on the source.
*
* @MigrateProcessPlugin(
* id = "mds_paragraph"
* )
*/
class ParagraphMigrateProcessor extends ParagraphProcessBase {
@cocoy
cocoy / example.tf
Last active February 14, 2018 10:53
### NOTE:
### You need to input your ACCESS_KEY, SECRET_KEY, KEYPAIR_NAME, VPC_ID
###
provider "aws" {
access_key = "YOUR_ACCESS_KEY"
secret_key = "YOUR_SECRET_KEY"
region = "us-west-2"
}
## Instance Declaration
@gauravtiwari
gauravtiwari / window-auth-popup.es6.js
Last active December 5, 2024 18:40
Promise based popup window for server oAuth
/* global window */
const popup = (url) => {
const windowArea = {
width: Math.floor(window.outerWidth * 0.8),
height: Math.floor(window.outerHeight * 0.5),
};
if (windowArea.width < 1000) { windowArea.width = 1000; }
if (windowArea.height < 630) { windowArea.height = 630; }
@mackensen
mackensen / .gitlab-ci.yml
Created November 14, 2016 15:49
Mocked up gitlab config for running selenium in a linked container
# Custom docker image which exposes 8080
image: lafayette/hoth:5.5
services:
- selenium/standalone-chrome:latest
before_script:
# Use 0.0.0.0 instead of localhost to allow external connections
- php -S 0.0.0.0:8080 -t ../ &> /dev/null &
@dsnopek
dsnopek / block-annotation-with-context.php
Last active September 20, 2018 15:54
Drupal 8 block annotation with context example
/**
* @Block(
* id = "my_block",
* context = {
* "node" = @ContextDefinition("entity:node")
* }
* )
*/
@jkullick
jkullick / docker-ufw-allow.md
Last active June 27, 2018 04:29
Allow Docker in UFW

/etc/default/ufw:

...
DEFAULT_FORWARD_POLICY="ACCEPT"
service ufw restart
ufw allow in on docker0
ufw allow out on docker0