Skip to content

Instantly share code, notes, and snippets.

View dmadisetti's full-sized avatar
🇩🇲
Set status

Dylan Madisetti dmadisetti

🇩🇲
Set status
View GitHub Profile
@dmadisetti
dmadisetti / generate-wildcard-certificate.sh
Last active July 2, 2024 17:21 — forked from PowerKiKi/generate-wildcard-certificate.sh
Generate self-signed wildcard SSL certificate for development environment
#!/usr/bin/env bash
# print usage
DOMAIN=$1
if [ -z "$1" ]; then
echo "USAGE: $0 tld"
echo ""
echo "This will generate a non-secure self-signed wildcard certificate for "
echo "a given development tld."
echo "This should only be used in a development environment."
@dmadisetti
dmadisetti / histogram2d.py
Last active October 28, 2021 20:28 — forked from isentropic/histogram2d.py
Tensorflow histogram2d (Simple implementation)
@tf.function
def histogram(x, y,
value_range,
nbins=100,
weights=None,
bin_dtype=tf.dtypes.int32):
"""
Bins x, y coordinates of points onto simple square 2d histogram
Given the tensor x and y:
app.filter('parseUrl', function() {
var //URLs starting with http://, https://, or ftp://
replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,
//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim,
//Change email addresses to mailto:: links.
replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;
return function(text, target, otherProp) {
if(!text) return;
@dmadisetti
dmadisetti / hxckz.sh
Last active November 29, 2023 04:31 — forked from bavardage/gist:939140
Google Docs Hack
#!/bin/sh
# Short script to auto format on save
MATCHING=false;
press(){
xte "$1";
if [ "x" = "$2x" ]; then
sleep 0.05;
@dmadisetti
dmadisetti / Corresponding Node Server
Last active December 17, 2015 13:59 — forked from frockenstein/GreasemonkeyUpload.js
Craigslist with auth
// Hats off to https://gist.github.com/hackable/1294667
var express = require('express'),
request = require('request'),
BufferList = require('bufferlist').BufferList,
sys = require('sys'),
fs = require('fs');
var app = express.createServer();