Skip to content

Instantly share code, notes, and snippets.

@adrienne
adrienne / gist:3180103
Created July 26, 2012 03:38
Haversine formula (PHP/MySQL)
/**
* Generates the string for the Haversine function. We assume that the `zipcode`, `latitude`,
* and `longitude` columns are named accordingly. We are also not doing much error-checking
* here; this is a simple text cruncher to make things prettier.
* We may also be integrating some extra SQL in, passed in via the $extra parameter
*
* @param string $table The table to search in
* @param float $lat The latitude part of the reference coordinates
* @param float $lng The longitude part of the reference coordinates
* @param int $radius The radius to search within
@adrienne
adrienne / adrienne-utilities.htaccess
Created October 4, 2011 20:47
A handy set of .htaccess declarations that I can pick and choose from for various projects
SetEnv APPLICATION_ENV development
SetEnv DEBUG_FIREPHP enabled
# Access in PHP:
# // Define application environment
# defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
# // Enable FirePHP for testing?
# defined('DEBUG_FIREPHP') || define('DEBUG_FIREPHP', (getenv('DEBUG_FIREPHP') ? getenv('DEBUG_FIREPHP') : 'disabled'));
Options All -Indexes
Options +FollowSymLinks
# ----------------------------------------------------------------------
# 5G BLACKLIST/FIREWALL (2013)
# @ http://perishablepress.com/5g-blacklist-2013/
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# 5G:[QUERY STRINGS]
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
@adrienne
adrienne / NerderyVPN.bat
Created May 23, 2012 09:39
A batch file to connect to the VPN and mount the network storage as a drive
@echo off
if exist n:\home goto DISCONNECTME else goto CONNECTME
:CONNECTME
REM NOTE: in all of the below variables EXCEPT for mydrivename , double-quote the values!
REM This is the name of the VPN you've got set up
set myvpnname="Name of your VPN connection"
@adrienne
adrienne / peanutsauce.md
Last active August 26, 2021 16:48
Peanut sauce recipe

Quick Noodles with Peanut Sauce

(serves 4, or one person four times)

For the sauce:

  • 1/2 cup peanut butter plus a little
  • 1/4 cup canned coconut milk (like half of one of the small-size cans. You can freeze the rest, or make a double batch)
  • 3tbsp soy sauce
  • 2tbsp lime juice (the cheap stuff in a bottle is fine)
  • 2tbsp of ginger from a jar of crushed ginger (or fresh ginger)
@adrienne
adrienne / EE RSS Feed (Dynamic)
Last active December 7, 2021 06:32
EE sample feed; multiple entries if no third segment, otherwise comments from single entry. REQUIRES STASH.
<?xml version="1.0" encoding="{charset}"?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:ee="http://ellislab.com/">
@adrienne
adrienne / fix.css
Last active March 10, 2022 07:22
Fix Stupid Shit on New Twitter
/* Install the STYLUS extension (not STYLISH, that one's got malware these days)
Stylus for Chrome: https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne
Stylus for FF: https://addons.mozilla.org/en-US/firefox/addon/styl-us/
Once it's installed, go to Twitter, click the button, and choose:
Create a new style -> for all URLs at twitter.com
Paste this code into the created style, then save!
*/
html body, [data-testid="primaryColumn"], .r-1h3ijdo {
@adrienne
adrienne / gist:3977777
Created October 30, 2012 01:27
How to follow an organization on gitHub
Paste this into the console in your browser:
$.post("https://github.com/users/follow?target=organizationName");
@adrienne
adrienne / keybase.md
Created December 7, 2022 17:23
keybase.md

Keybase proof

I hereby claim:

  • I am adrienne on github.
  • I am adrienneleigh (https://keybase.io/adrienneleigh) on keybase.
  • I have a public key ASCabIq5Jp4cTSD2jfkZ3oMtddxXCXlihzjbzBIgNpRnCQo

To claim this, I am signing this object:

@adrienne
adrienne / quixCommands.txt
Last active August 30, 2023 22:13
Commands for the truly awesome Quix bookmarklet
> Killing the default commands
> Note that ALL spaces must be removed from bookmarklets, and %-encoded characters must be changed back to normal.
#kill-defaults
> Begin new commands (many copied from original Quix)
@Searching
ama https://www.amazon.com/s/?field-keywords=%s Amazon Search