Skip to content

Instantly share code, notes, and snippets.

View assada's full-sized avatar
🥒
Pickle Alex

Oleksii Ilienko assada

🥒
Pickle Alex
View GitHub Profile
@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
@weapp
weapp / nginx.conf
Created August 4, 2014 17:21
Return common errors as json in Nginx
error_page 500 /500.html;
location /500.html{
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}';
}
error_page 502 /502.html;
location /502.html{
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';
}
86937 isset
43159 echo
31697 empty
29252 substr
26146 count
24248 is_array
22572 strlen
19365 sprintf
18090 unset
16584 str_replace
@techjanitor
techjanitor / gcs.go
Created May 9, 2015 04:08
Upload a file to Google Cloud Storage
package main
import (
"errors"
"fmt"
"golang.org/x/oauth2"
"golang.org/x/oauth2/jwt"
storage "google.golang.org/api/storage/v1"
"os"
)
@tabacitu
tabacitu / gist:dbcfd71375e72c857474
Last active April 20, 2020 09:05
Tabacitu Laravel Package Service Provider boilerplate code
<?php
namespace League\Skeleton;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
class SkeletonServiceProvider extends ServiceProvider
{
/**
@disem
disem / lepra-plus-inbox
Created July 8, 2015 09:03
плюсануть в карму весь инбокс
var withProperty = [], els = document.getElementsByTagName('a'), i = 0;
for (i = 0; i < els.length; i++) {
if (els[i].hasAttribute('data-user_id')) {
ajaxObject = new XMLHttpRequest();
ajaxObject.open("POST", "/ajax/user/karma/vote/", true);
ajaxObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajaxObject.send('user=' + els[i].getAttribute('data-user_id') + '&karma_value=' + 2 + '&csrf_token=' + encodeURIComponent(globals.user.csrf_token));
}
}
_log_pskb(date_created,link_id,logname,log)
account(id,uid,sum)
account_attach(account_id,file_id,name,orig_name)
account_transaction(user_id,yd)
activate_service(code,email,data)
admin_log_users(user_id,log_id,last_comment_view)
annoy(ip,last_req)
articles(title,short,msgtext,sign,logo,link)
articles_comments(from_id,parent_id,from_ip,created_time,article_id,msgtext,youtube_link)
articles_comments_files(comment_id,file_id,small,inline,temp)
@petrkohut
petrkohut / howto.md
Last active October 20, 2021 08:57
How to have redis-cli and psql installed on machine using Docker

How to install redis-cli and psql client on your machine with Docker

Preparing docker images

We will use minimalistic Linux distribution called Alpine (5MB)

Dockerfile of redis-cli

FROM alpine:latest
RUN apk --update add redis
@wesrice
wesrice / AbstractEntity.php
Last active August 4, 2021 22:02
Self Validating Value Objects and Entities (Laravel Implementation)
<?php
abstract class AbstractEntity extends AbstractValueObject
{
/**
* Offset Set
*
* @param mixed $offset
* @param mixed $value
*
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 14, 2024 00:03
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub