Skip to content

Instantly share code, notes, and snippets.

View munir131's full-sized avatar
:octocat:

Munir Khakhi munir131

:octocat:
View GitHub Profile
@MelchiSalins
MelchiSalins / http-rate-limit.go
Last active October 31, 2023 14:40
GoLang HTTP Client with Rate Limiting
package main
import (
"context"
"fmt"
"net/http"
"time"
"golang.org/x/time/rate"
)
@munir131
munir131 / url.js
Created May 13, 2016 12:04
Functions for read write remove value from URL
window.getValueFromURL = function (name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
};
window.setToURL = function (key, value) {
var queryString;
window.removeFromURL(key);
@renzok
renzok / Dockerfile
Last active September 6, 2023 04:55
docker: mapping host uid and gid to user inisde container
FROM debian:jessie
ENV USER=boatswain USER_ID=1000 USER_GID=1000
# now creating user
RUN groupadd --gid "${USER_GID}" "${USER}" && \
useradd \
--uid ${USER_ID} \
--gid ${USER_GID} \
--create-home \