Skip to content

Instantly share code, notes, and snippets.

View rvvvt's full-sized avatar
💭
hail, traveler.

rvvvt rvvvt

💭
hail, traveler.
View GitHub Profile
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@jdevalk
jdevalk / .htaccess
Last active January 7, 2025 07:26
These three files together form an affiliate link redirect script.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>
@jongamble
jongamble / con_form.php
Created July 3, 2013 13:09
This is a basic contact form to build off of.
<?php //Let's Contact Form This Thing UP!
// Start Your PHP Sessions
session_start();
// Set the contact page variable for redirection later
$contact_page = get_permalink(48);
// Create the necessary variable that will be used in detecting errors
$errorFound = false;
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active September 2, 2026 17:24
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
mkdir -p ~/.ssh
# generate new personal ed25519 ssh keys
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <rob@rob.tn>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
@JamieMason
JamieMason / unfollow.js.md
Last active June 29, 2026 05:20
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

By @foldleft.bsky.social, see also Unfollow everyone on bsky.app.

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
@Supermathie
Supermathie / parseCSV.py
Created April 14, 2014 20:50
python CSV example
#!/usr/bin/env python
import csv
import sys
from pprint import pprint
csvreader = csv.reader(sys.stdin)
# Read the header line and extract the column names
header = csvreader.next()
@aarondai
aarondai / deferred.js
Created July 18, 2014 21:17
NodeJS:Multiple Async Operations
// Module Dependencies
var Q = require('q'),
request = require('request');
// Some URLs to play with, and a queue to keep the code readable
var urls = ['google.com', 'twitter.com', 'facebook.com'],
queue = [];
// A standard NodeJS function: a parameter and a callback; the callback
// will return error (if any) as first parameter and result as second
@elliotbonneville
elliotbonneville / topkeywords.js
Last active April 5, 2025 00:41
Find top keywords associated with a Google search with this Node.js application.
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
@vinovator
vinovator / XKCDDownloader.py
Last active June 10, 2018 06:19
Download all XKCD comics - incomplete
# Python 3
# XKCDDownloader.py
########################################################################################################################
# Algorithm
# 1) Open the latest page of XKCD
# 2) Download the image, title and alternate text from the page and save the images in specified folder
# 3) Build a html file which contains the alt, title and src in a html file
# 4) If any error in download skip the page
# 5) Find the previous page url from current page and repeat steps 2, 3 & 4
# 6) Continue until you find the very 1st comic