Skip to content

Instantly share code, notes, and snippets.

@brianyoungblood
brianyoungblood / gist:1589939
Created January 10, 2012 16:41
google maps and fusion table
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><style type="text/css">
html, body, #map_canvas {
margin: 0;
padding: 0;
height: 100%;
}
</style>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v=3.6&amp;sensor=false&amp;client=google-fusiontables">
</script>
@brianyoungblood
brianyoungblood / sanitize_drupal_users.sql
Created October 24, 2012 21:27
sanitize drupal users
UPDATE users SET pass = md5('mypasswordchanged2012') WHERE uid > 1;
UPDATE users SET mail = concat('myaddr+', replace(mail, '@', '_'), '@testdomain.org') WHERE uid <> 0 AND instr(mail, '@testdomain.org') = 0;
@brianyoungblood
brianyoungblood / gist:6532023
Last active December 22, 2015 21:19 — forked from alanchrt/gist:1014534
Highlight all addresses to find county only - new column is created and cells are populated with county.
/*****************************************************************************\
* Batch Spreadsheet geocode find county *
* Author: Alan Christopher Thomas *
* http://alanchristopherthomas.com/ *
\*****************************************************************************/
//Pull counties (administrative_area_level_2) from Google geocoder
function onOpen() {
// Add the Geocode menu
SpreadsheetApp.getActiveSpreadsheet().addMenu("Geocoder", [{
@brianyoungblood
brianyoungblood / gist:7035986
Created October 18, 2013 03:16
sample http post and return
<?php
$variable = fopen('http://google.com/', "rb");
echo stream_get_contents($variable);
?>
//$casper awardspdf-casper.js [startpath]
var casper = require('casper').create();
var _adminUser = ''; //drupal user
var _adminPass = ''; //drupal pass
var _baseURL = 'http://localhost:8080'; //no slash
var _loginPath = '/user';
@brianyoungblood
brianyoungblood / gist:9d0a5200063a3c353eae
Created May 28, 2015 19:54
download mailman Pipermail mbox format
https://[Pipermail_server]/mailman/private/[listname].mbox/[listname].mbox
@brianyoungblood
brianyoungblood / rescuetime_highlight.sh
Created August 9, 2015 22:11
Log commit messages as a 'highlight' in RescueTime Premium
#!/bin/sh
#
# Log commit messages as a 'highlight' in RescueTime Premium
#
# To enable this hook:
#
# 1. Place this file in your project's .git/hooks directory and make sure its name is "post-commit".
# 2. Make sure it has executable permissions (chmod +x post-commit)
# 3. All commits will be automatically logged as highlight events.
#
@brianyoungblood
brianyoungblood / gist:de76cb5c059d7d201101
Created November 6, 2015 18:49
progress with gzcat and mysql imports
pv dump.sql.gz | gzcat | mysql -uroot -p dbname
@brianyoungblood
brianyoungblood / NSLookup.gs
Last active January 22, 2016 00:39 — forked from mogsdad/NSLookup.gs
NSLookup - Google Sheets custom function to Perform a Network Service Lookup, using StatDNS API. From "Nslookup or dig in Google App Script" (http://stackoverflow.com/a/30610580/1677912).
/**
* Perform a Network Service Lookup, using StatDNS API.
*
* @param {"google.com"} dn A well-formed domain name to resolve.
* @return {String} Resolved IP address
* @customfunction
*/
function NSLookup(dn) {
// From gist.github.com/mogsdad/ece531531e0ef5dc355d
<?php
//$server_name = $_SERVER["SERVER_NAME"]
$server_name = "3b38a450c-92602-463c8-5581855-84c64c57741f--pr-389.probo.build";
// Get parts of the domain to use subdomain later.
$domain_parts = explode('.',$server_name);