Skip to content

Instantly share code, notes, and snippets.

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

rvvvt rvvvt

💭
hail, traveler.
View GitHub Profile
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@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 November 28, 2023 20:28
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 July 11, 2024 10:06
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# 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
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
@JamieMason
JamieMason / unfollow.js.md
Last active July 13, 2024 16:36
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  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)
// https://gist.github.com/JamieMason/7580315
//
@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 August 23, 2022 10:26
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++;