Skip to content

Instantly share code, notes, and snippets.

View sajith-rahim's full-sized avatar
🏠
Working from home

Sajith Rahim sajith-rahim

🏠
Working from home
View GitHub Profile
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.nio.file.Files;
import java.nio.file.Paths;
# ghub:Johnson468
import pyautogui
import time
import sys
from datetime import datetime
pyautogui.FAILSAFE = False
numMin = 1
@sajith-rahim
sajith-rahim / git-09-11-2016.md
Last active August 20, 2022 22:03
Old Git Notes.

Version Control System

Types

  1. Local VCS
				> stored in hardisk.
				> no interaction/sharing
				> lost if HDD fails
  1. Centralized VCS
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>
mermaid.initialize({startOnLoad:true});
</script>
<style>
.mermaid { /* add custom styling */ }
</style>
<!--This will render scripts when the document loads once.
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
    iframe->>dotcom: iframe ready
    dotcom->>iframe: set mermaid data on iframe
@sajith-rahim
sajith-rahim / serve_gh_js_via_cdn.md
Last active December 29, 2022 12:35
Using / Hosting and distributing js files in Github via jsDelivr

Hosting and serving js files in Github via jsDelivr

Use jsDelivr Github Tool

Manual Steps

  1. Open the raw version of your file in Github and copy the url
let regex_map: HashMap<&str, Regex> = [
("credit_card", Regex::new(r"\b(\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4})\b").unwrap()),
("email", Regex::new(r"\b([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})\b").unwrap()),
("url", Regex::new(r"((?:https?|ftp)://[^\s/$.?#].[^\s]*)").unwrap()),
("ip_address", Regex::new(r"\b((?:\d{1,3}\.){3}\d{1,3})\b").unwrap()),
("social_security", Regex::new(r"\b(\d{3}-\d{2}-\d{4})\b").unwrap()),
("ipv6_address", Regex::new(r"([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7})").unwrap()),
("phone_number", Regex::new(r"\b(\d{3}[-.\s]?\d{3}[-.\s]?\d{4})\b").unwrap()),
("srv_dns", Regex::new(r"\b(.+?)\s+IN\s+SRV\s+\d+\s+\d+\s+\d+\s+(.+)\b").unwrap()),
("mac_address", Regex::new(r"([0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5})").unwrap()),