Skip to content

Instantly share code, notes, and snippets.

T. Brian Jones tbrianjones

Block or report user

Report or block tbrianjones

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tbrianjones
tbrianjones / tweet_dumper.py
Created Jan 29, 2017 — forked from yanofsky/tweet_dumper.py
A script to download all of a user's tweets into a csv
View tweet_dumper.py
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
@tbrianjones
tbrianjones / download_file_to_client_computer.php
Last active Jan 18, 2019
Simple way to write data to a file and save it to a Client's computer when they click a link, using only PHP and HTML.
View download_file_to_client_computer.php
<?php
// this is a single page that can access and write any data to a file
// on a clients computer when they click a link using only HTML and PHP
//
// this will keep the data between page loads
session_start();
// download file if $_GET['download_file'] is set to true
@tbrianjones
tbrianjones / gist:6c139e9db0180992abd2
Created Aug 18, 2014
Simple English Stop Word List
View gist:6c139e9db0180992abd2
'll
a
a
able
about
about
above
abst
accordance
according
@tbrianjones
tbrianjones / sqs_web_manager.php
Last active Aug 1, 2016
A Simple Web App to manage Amazon SQS Queues ... delete/clear ... and add items to the queues ... all via web forms.
View sqs_web_manager.php
<?php
// include api config file
require_once( dirname( __FILE__ ) . '/../../config.php' );
// create aws sqs conneciton
require_once( BASE_PATH . 'libraries/aws_php_sdk_v2/vendor/autoload.php' );
use Aws\Sqs\SqsClient;
try {
$config = array(
@tbrianjones
tbrianjones / whitespacePhraseTokenizer.php
Created Aug 7, 2014
A Whitespace Tokenizer for PHP-NLP-TOOLS that creates specified ngrams ( unigrams, bigrams, trigrams, etc. )
View whitespacePhraseTokenizer.php
<?php
namespace NlpTools\Tokenizers;
/**
* White space phrase tokenizer.
* Break on every white space
* Create ngrams with the specified number of words ( $n )
*/
class WhitespacePhraseTokenizer implements TokenizerInterface
@tbrianjones
tbrianjones / Inflect.php
Last active Jul 22, 2019
A PHP Class for converting English words between Singular and Plural.
View Inflect.php
<?php
// original source: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
/*
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy
@tbrianjones
tbrianjones / beach_volleyball_sand_workouts.md
Last active Mar 13, 2019
Sand workouts based on beach volleyball drills and gameplay.
View beach_volleyball_sand_workouts.md

Beach Volleyball Sand Workout

Workout Notes

  • workout time
    • most exercises will take 1:30-2:00 minutes ( with windsprint and rest )
    • 3x through 8 of these will be roughly 45min
  • windsprints between each workout ( roughly ~10-15 seconds, full speed )
  • 30 seconds after each windsprint ( adjust accordingly to keep heart rate up )
@tbrianjones
tbrianjones / gist:6531036
Created Sep 11, 2013
A pretty good regular expression to extract US addresses from free text.
View gist:6531036
<?php
$regex = "/\b(p\.?\s?o\.?\b|post office|\d{2,5})\s*(?:\S\s*){8,50}(AK|Alaska|AL|Alabama|AR|Arkansas|AZ|Arizona|CA|California|CO|Colorado|CT|Connecticut|DC|Washington\sDC|Washington\D\.C\.|DE|Delaware|FL|Florida|GA|Georgia|GU|Guam|HI|Hawaii|IA|Iowa|ID|Idaho|IL|Illinois|IN|Indiana|KS|Kansas|KY|Kentucky|LA|Louisiana|MA|Massachusetts|MD|Maryland|ME|Maine|MI|Michigan|MN|Minnesota|MO|Missouri|MS|Mississippi|MT|Montana|NC|North\sCarolina|ND|North\sDakota|NE|New\sEngland|NH|New\sHampshire|NJ|New\sJersey|NM|New\sMexico|NV|Nevada|NY|New\sYork|OH|Ohio|OK|Oklahoma|OR|Oregon|PA|Pennsylvania|RI|Rhode\sIsland|SC|South\sCarolina|SD|South\sDakota|TN|Tennessee|TX|Texas|UT|Utah|VA|Virginia|VI|Virgin\sIslands|VT|Vermont|WA|Washington|WI|Wisconsin|WV|West\sVirginia|WY|Wyoming)(\s+|\&nbsp\;|\<(\S|\s){1,10}\>){1,5}\d{5}/i";
?>
@tbrianjones
tbrianjones / gist:6515916
Last active Dec 22, 2015
Used to import NOAA tide data into a Calendar CSV format for Google Calendar. http://tidesandcurrents.noaa.gov/tide_predictions.shtml?gid=235
View gist:6515916
<?php
// how to use
//
// 1.) download a tide chart from here: http://tidesandcurrents.noaa.gov/tide_predictions.shtml?gid=235
//
// 2.) cut and paste just the tide data into the $contents variable below
//
// 3.) update $location, and set the default time zone
//
@tbrianjones
tbrianjones / remove_philterit_for_gmail_labels.php
Created Aug 21, 2013
Gist to delete Gmail Labels created by the Gmail plugin called Philterit.
View remove_philterit_for_gmail_labels.php
<?php
// delete all labels / folders created by Philterit for Gmail
//
// - Philterit is an app that organizes your gmail by applying labels
// to emails for all the brands that email you. Philterit shut down,
// but the labels ( thousands of them ) remained in my Gmail account.
//
// - this app removes them all in bulk.
//
You can’t perform that action at this time.