Skip to content

Instantly share code, notes, and snippets.

View kudapara's full-sized avatar
🌀
Verified

Kudakwashe Paradzayi kudapara

🌀
Verified
View GitHub Profile
class BaseClient
class APINotFound < StandardError; end
attr_reader :auth_strategy
def initialize(auth_strategy: :headers, headers: {})
@auth_strategy = auth_strategy
@headers = headers
end
@jamesdube
jamesdube / regex.txt
Last active February 5, 2024 14:29
Zimbabwe National ID Regex
# 00000000X00
/([0-9]{8,9}[a-z,A-Z][0-9]{2})/g
# 00-000000-X-00 dashes are optional
/([0-9]{2}-?[0-9]{6,7}-?[a-z,A-Z]-?[0-9]{2})/g
# 00-000000 X00 dash is required, space before letter is optional
/([0-9]{2}-[0-9]{6,7}\s?[a-z,A-Z][0-9]{2})/g
@facultymatt
facultymatt / roles_invesitgation.md
Last active April 16, 2024 09:31
Roles and permissions system for Nodejs
@balupton
balupton / cors.js
Created September 11, 2012 05:21
Acheiving CORS via a Node HTTP Server
// Create our server
var server;
server = http.createServer(function(req,res){
// Set CORS headers
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Request-Method', '*');
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
res.setHeader('Access-Control-Allow-Headers', '*');
if ( req.method === 'OPTIONS' ) {
res.writeHead(200);