Skip to content

Instantly share code, notes, and snippets.

View jalbertbowden's full-sized avatar

albert jalbertbowden

View GitHub Profile
@jalbertbowden
jalbertbowden / directory-loop.sh
Last active May 9, 2019 19:02
Bash script to loop through all directories in a given directory, and convert all .shp -> .geojson.
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
for f in /*;
do
for var in *.shp; do shp2geojson ${var%\.*}; done
done;
// original from: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
// original gist: https://gist.github.com/willpatera/ee41ae374d3c9839c2d6
function doGet(e){
return handleResponse(e);
}
// Enter sheet name where data is to be written below
var SHEET_NAME = "Sheet1";
<form id="test-form">
<div>
<label>Field 1</label>
<input type="text" name="form_field_1" placeholder="Field 1"/>
</div>
<div>
<label>Field 2</label>
<input type="text" name="form_field_2" placeholder="Field 2"/>
@jalbertbowden
jalbertbowden / map.geojson
Created April 12, 2019 02:54
Shipwrecks - via Google My Maps
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Westmoreland County and the Northern Neck of Virginia offer many things to do and see to go along with your visit to Stratford Hall. Plan on a day trip or make it a weekender! Stratford Hall is also part of several regional and state birding, biking, hiking and history trails. We offer the following links to help you plan your visit:

@jalbertbowden
jalbertbowden / url-to-domain.php
Created March 29, 2019 23:22
Get the domain name from a URL for display purposes in PHP
<?php
// This is PHP function to convert a user-supplied URL to just the domain name,
// which I use as the link text.
// Remember you still need to use htmlspecialchars() or similar to escape the
// result.
function url_to_domain($url)
{
@jalbertbowden
jalbertbowden / js-object-length.js
Created March 29, 2019 23:19
Get object length by checking the key
// http://stackoverflow.com/a/18560314
// if condition is for old IE
if (!Object.keys) {
Object.keys = function (obj) {
var arr = [],
key;
for (key in obj) {
if (obj.hasOwnProperty(key)) {
arr.push(key);
}

AirDrop Shortcut

  1. Put this command in Terminal cd /System/Library/CoreServices/Finder.app/Contents/Applications && open .
  2. Drag "AirDrop" to Dock
@jalbertbowden
jalbertbowden / checkEmail.php
Created March 24, 2019 01:37 — forked from voku/checkEmail.php
check for E-Mail
<?php
/**
* checkEmail
*
* @param String $email
* @param Boolean $mxCheck (do not use, if you don't need it)
*
* @return Boolean
*/
@jalbertbowden
jalbertbowden / virginia-prisons-and-elected-officials.md
Last active March 18, 2019 18:31
virginia prisons and their elected officials. reference: https://vadoc.virginia.gov/facilities/
  • 1821 Estaline Valley Road
  • Craigsville, Virginia 24430
  • (540) 997-7000
  • State Delegate
  • Ronnie R. Campbell
  • District:24
  • Party:R