Skip to content

Instantly share code, notes, and snippets.

View geordee's full-sized avatar
🔥

Geordee Naliyath geordee

🔥
View GitHub Profile
@geordee
geordee / batch-api-min.conf
Created August 25, 2018 04:23 — forked from nginx-gists/batch-api-min.conf
Batching API Requests with NGINX Plus and the NGINX JavaScript Module
js_include batch-api-min.js;
# keyval_zone for APIs where the last portion of the URI is an argument
# The key is the portion of the URL before the last part
keyval_zone zone=batch_api:64k state=/etc/nginx/state-files/batch-api.json;
keyval $uri_prefix $batch_api zone=batch_api;
# keyval_zone for APIs where the last portion of the URI is an argument
# The key is the URI
keyval_zone zone=batch_api2:64k state=/etc/nginx/state-files/batch-api2.json;
@geordee
geordee / README.md
Created August 25, 2018 05:06 — forked from magnetikonline/README.md
Nginx embedded variables.
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \
@geordee
geordee / emirates-id.html
Last active January 17, 2025 22:18
Validate Emirates ID
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Validate Emirates ID</title>
<link rel="stylesheet" href="https://unpkg.com/mvp.css">
<style>
section {
display: flex;
@geordee
geordee / timestamps.java
Created April 19, 2021 09:26
Timestamp Conversion and Comparison
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.util.Date;
class Main {
public static void main(String args[]) {
String documentDateTime = "2022-02-02T12:00:00+04:00";
String createDateTime = "2022-02-02T08:15:00.000Z";
@geordee
geordee / semaphore.go
Created December 28, 2022 10:17 — forked from lxwagn/semaphore.go
Idiomatic semaphore example in Go (using Buffered Channels)
// Idiomatic Semaphore Example in Go
// Lucas Wagner
// Golang has no built-in facility to implement semaphores, so a common design
// pattern is to use buffered channels.
package main
import (
"fmt"
@geordee
geordee / gist:54b04bf2482e9afb60d9d303382963ba
Created March 28, 2023 06:53
Prevent rootless containers from exiting once the user session exits
loginctl enable-linger $UID