Skip to content

Instantly share code, notes, and snippets.

View furkanuyar's full-sized avatar

Furkan Uyar furkanuyar

View GitHub Profile
@pkosiec
pkosiec / example-document.js
Created November 1, 2018 22:16
Example import data in JS
const names = ["John", "Joanne", "Bob", "Will", "Chris", "Mike", "Anna", "Jack", "Peter", "Paul"];
module.exports = names.map(name => ({
name,
email: "example@example.com",
avatar: "https://placekitten.com/300/300",
}))
@henriquemenezes
henriquemenezes / postgresql-set-id-seq.sql
Created March 31, 2016 12:23
PostgreSQL set Next ID Sequence Value to MAX(id) from Table
-- Get Max ID from table
SELECT MAX(id) FROM table;
-- Get Next ID from table
SELECT nextval('table_id_seq');
-- Set Next ID Value to MAX ID
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
@piatra
piatra / kafka_start.sh
Last active May 28, 2023 19:18
start zookeeper and kafka in the background and create a topic
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Please supply topic name"
exit 1
fi
nohup bin/zookeeper-server-start.sh -daemon config/zookeeper.properties > /dev/null 2>&1 &
sleep 2
nohup bin/kafka-server-start.sh -daemon config/server.properties > /dev/null 2>&1 &