Skip to content

Instantly share code, notes, and snippets.

nerdsrescueme / regex.txt
Created September 23, 2011 16:08
Common Regex
View regex.txt
Perl and PHP Regular Expressions
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters.
All Major Credit Cards
This regular expression will validate all major credit cards: American Express (Amex), Discover, Mastercard, and Visa.
//All major credit cards regex
atomize / GASjson2SS.js
Last active December 11, 2023 21:26 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
View GASjson2SS.js
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = Utilities.jsonParse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
View Vagrant network config : NAT + NAT network + HostOnly
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
doraTeX /
Last active December 11, 2023 21:23
A shell script to perform OCR on images/PDFs using macOS built-in OCR engine
SCRIPTNAME=$(basename "$0")
function realpath () {
if [ -d "$f" ]; then
base="/$(basename "$f")";
ihsangan / index.js
Last active December 11, 2023 21:21
Send email from Workers with MailChannel API
View index.js
async function readRequestBody(request) {
const { headers } = request;
const contentType = headers.get('content-type') || '';
if (contentType.includes('application/json')) {
return JSON.stringify(await request.json());
} else if (contentType.includes('form')) {
const formData = await request.formData();
const body = {};
for (const entry of formData.entries()) {
body[entry[0]] = entry[1];
amulyakashyap09 /
Last active December 11, 2023 21:10
How to query in elastic-search


We will be using following information throughout this article:

  • index_name : customers
  • index_type : personal
  • customer will have name,age,gender,email,phone,address,city,state as fields in schema for now

INFO Queries

jhermsmeier /
Last active December 11, 2023 21:10
Windows Product Keys


These are NOT product / license keys that are valid for Windows activation.
These keys only select the edition of Windows to install during setup, but they do not activate or license the installation.


HStep20 /
Last active December 11, 2023 21:07
This script will read your Overseer data and create/apply user tags to all of your sonarr/radarr instances
This script will read your Overseer data and create/apply user tags to all of your sonarr/radarr instances, then create a filter in each connected -arr application for the users you specify.
It is forward compatible with the future User Tagging feature of overseer, and formats the tag in the same 'id - lowercase username' pattern Overseer will
It only uses built in python libraries, so you should be able to download and run without much hassle.
This will NOT utilize docker-compose style hostnames at the moment, and I don't use them personally, so I don't see myself adding them
Steps to use:
nirbhayph / Circles.kt
Last active December 11, 2023 21:06
Google Maps and Jetpack Compose
View Circles.kt
fun CircleMap() {
// Define the coordinates for circle centers and their associated information
val circleData = listOf(
CircleInfo("Park A", LatLng(37.7749, -122.4194), "This is Park A"),
CircleInfo("Park B", LatLng(36.7783, -119.4179), "This is Park B"),
CircleInfo("Park C", LatLng(34.0522, -118.2437), "This is Park C")
// Create a mutable state to track the selected circle
DaniJG / .github_actions_databricks-cli-install_action.yaml
Last active December 11, 2023 21:04
Github actions for databricks
View .github_actions_databricks-cli-install_action.yaml
name: 'databricks-cli-install'
description: 'Install latest version of the databricks CLI'
using: "composite"
# this is the new CLI, distributed as a standalone executable that doesnt need Python:
- shell: bash
run: |
curl -fsSL | sh