Skip to content

Instantly share code, notes, and snippets.

View meysampg's full-sized avatar
🖖
bit bit 0 bit

Meysam P. Ganji meysampg

🖖
bit bit 0 bit
View GitHub Profile
@carolynvs
carolynvs / .gitconfig
Last active October 19, 2022 14:44
git wip - Show what branches you have been working on lately
[alias]
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
@sinushx
sinushx / cool-ls.go
Last active May 10, 2019 11:44
a ls-like program in go
package main
import (
"flag"
"fmt"
"github.com/fatih/color"
"log"
"os"
"strconv"
"strings"
@mahdavipanah
mahdavipanah / gsc.sh
Created December 6, 2018 10:13
Zsh function for git checkout and create a branch
function gsc() {
git branch | grep -w "$1" > /dev/null;
if [ $? = 0 ]; then
git checkout "$1";
else
git checkout -b "$1";
fi
}
{
"errors": {
"0": "تراكنش با موفقيت انجام شد",
"11": "شماره كارت نامعتبر است",
"12": "موجودي كافي نيست",
"13": "رمز نادرست است",
"14": "تعداد دفعات وارد كردن رمز بيش از حد مجاز است",
"15": "كارت نامعتبر است",
"16": "دفعات برداشت وجه بيش از حد مجاز است",
"17": "كاربر از انجام تراكنش منصرف شده است",
@gaearon
gaearon / modern_js.md
Last active April 18, 2024 15:01
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
<?php
$directories = ['application', 'library', 'database', ''];
define("CWD", dirname(__FILE__));
echo '<h1>Parallel PHP Linter</h1>';
$time_start = microtime(true);

Source: https://gist.github.com/findepi/04c96f0f60dcc95329f569bb0c44a0cd .

quick build

./mvnw -T2C clean install -nsu -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Dair.check.skip-all=true -pl '!:trino-server-rpm,!:trino-docs,!:trino-proxy,!:trino-verifier,!:trino-benchto-benchmarks'

run Trino in a container, quickly

docker rm -f trino; docker run --rm -it --name trino -p 8080:8080 trinodb/trino:438
@marwei
marwei / how_to_reset_kafka_consumer_group_offset.md
Created November 9, 2017 23:39
How to Reset Kafka Consumer Group Offset

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@voluntas
voluntas / sysctl.conf
Created October 14, 2017 13:07 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@gotterdemarung
gotterdemarung / cas.go
Created May 3, 2017 08:00
Compare-and-swap VS mutex
package util
import (
"sync"
"sync/atomic"
"testing"
)
type cas struct {
value int64