Skip to content

Instantly share code, notes, and snippets.

View thearyanahmed's full-sized avatar

Aryan Ahmed thearyanahmed

View GitHub Profile
@sazid
sazid / DBUtils.kt
Created August 30, 2021 06:59
Database utilities for JDBC
package io.github.sazid
import java.sql.Connection
import java.sql.Date
import java.sql.PreparedStatement
import java.sql.ResultSet
import java.time.LocalDate
import javax.sql.DataSource
typealias RowMapper<T> = (ResultSet) -> T
@vicgonvt
vicgonvt / deployment_guide.md
Last active February 17, 2025 19:29
Deployment Guide for Ubuntu Server from Scratch with Laravel
@Artistan
Artistan / Appendable.md
Created November 5, 2018 16:21
Make a model dynamically appendable.
thread goroutine
OS threads are managed by kernal and has hardware dependencies. goroutines are managed by go runtime and has no hardware dependencies.
OS threads generally have fixed stack size of 1-2MB goroutines typically have 8KB (2KB since Go 1.4) of stack size in newer versions of go
Stack size is determined during compile time and can not grow Stack size of go is managed in run-time and can grow up to 1GB which is possible by allocating and freeing heap storage
There is no easy communication medium between threads. There is huge latency between inter-thread communication. goroutine use channels to communicate with other goroutines with low latency (read more).
Threads have identity. There is TID which identifies each thread in a process. goroutine do not have any identity. go implemented this because go does not have TLS([Thread Local Storage](https://msdn.microsoft.com/en-us/library/win
@DevoKun
DevoKun / kafka.md
Created July 13, 2018 02:52
How to operate Kafka, mostly using Docker

Kafka Distributed Streaming Platform

Publish and Subscribe / Process / Store

Start Kafka

  • Kafka uses ZooKeeper as a distributed backend.

Start Zookeeper

@hotdang-ca
hotdang-ca / distance.go
Last active April 3, 2025 20:24
Golang code to calculate distance between two lat/lng decimal coordinates.
package main
import (
"math"
"fmt"
)
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//::: :::
//::: This routine calculates the distance between two points (given the :::
@wiratama
wiratama / laravel-mix-cheatsheet
Last active July 20, 2021 22:19
Laravel mix API cheat sheet
/*** Laravel mix API cheat sheet **/
mix.js(src, output);
mix.react(src, output); /** Identical to mix.js(), but registers React Babel compilation. **/
mix.extract(vendorLibs);
mix.sass(src, output);
mix.standaloneSass('src', output); /** Faster, but isolated from Webpack. **/
mix.fastSass('src', output); /** Alias for mix.standaloneSass(). **/
mix.less(src, output);
mix.stylus(src, output);
mix.postCss(src, output, [require('postcss-some-plugin')()]);
@enricofoltran
enricofoltran / main.go
Last active April 6, 2025 09:48
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@carlessanagustin
carlessanagustin / Nginx_Cheat_Sheet.md
Last active April 21, 2025 02:32
Nginx Cheat Sheet
@subfuzion
subfuzion / global-gitignore.md
Last active April 26, 2025 20:14
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.