Skip to content

Instantly share code, notes, and snippets.

View geordee's full-sized avatar
🔥

Geordee Naliyath geordee

🔥
View GitHub Profile
@geordee
geordee / gist:54b04bf2482e9afb60d9d303382963ba
Created March 28, 2023 06:53
Prevent rootless containers from exiting once the user session exits
loginctl enable-linger $UID
@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 / 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 / emirates-id.html
Last active February 20, 2024 06:32
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;
#!/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 / README.md
Created August 25, 2018 05:06 — forked from magnetikonline/README.md
Nginx embedded variables.
@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 / pivot.py
Created July 23, 2017 07:00
Pivot a table using Python/Pandas
#!/usr/bin/env python
import os
import numpy
import pandas
xlsx = './workbook.xlsx'
df = pandas.read_excel(open(xlsx,'rb'), sheetname=1)
df2 = pandas.pivot_table(df,
@geordee
geordee / unpivot.py
Created July 23, 2017 06:59
Unpivot a table using Python/Pandas
#!/usr/bin/env python
import os
import numpy
import pandas
xlsx = './workbook.xlsx'
df = pandas.read_excel(open(xlsx,'rb'), sheetname=0)
id_vars = ['Department', 'Category', 'Item']

Keybase proof

I hereby claim:

  • I am geordee on github.
  • I am geordee (https://keybase.io/geordee) on keybase.
  • I have a public key whose fingerprint is B080 8F53 E444 1D52 1AEB EC98 F8C6 6936 5C6E 4DC6

To claim this, I am signing this object: