Skip to content

Instantly share code, notes, and snippets.

View slavingia's full-sized avatar

Sahil Lavingia slavingia

View GitHub Profile
import datetime
# https://x.com/shl/status/926024538
# Found via https://x.com/search?q=from%3Ashl%20until%3A2008-09-19&src=typed_query&f=live
# Define dates
first_tweet_date = datetime.date(2008, 9, 18)
today = datetime.date.today()
birth_date = datetime.date(1992, 8, 25)
@slavingia
slavingia / create_pr.sh
Created September 13, 2024 17:13
Create a (draft) pull request using GitHub CLI
#!/bin/bash
# Create a (draft) pull request using GitHub CLI.
# It assigns the PR to the current user, fills in the title from the first commit,
# and uses the PR template file for the description.
set -euo pipefail
# Colors for output
RED='\033[0;31m'
listener = function(ev) {
if (ev.data && JSON.parse(ev.data).post_message_name == "sale") {
document.getElementById('post-message-data').innerHTML = ev.data;
}
}
window.addEventListener('message', listener, false);
@slavingia
slavingia / gist:1636854
Created January 19, 2012 00:51 — forked from gkoberger/gist:1636822
SOPA.js
/* Created by Sahil Lavingia
http://sahillavingia.com/ */
$(function() {
function alphaNumericCheck(theChar) {
return ! ((theChar < 48) || (theChar > 122) || ((theChar > 57) && (theChar < 65)) || ((theChar > 90) && (theChar < 97)));
}
function censor() {
var color = $(this).css('color'),