Skip to content

Instantly share code, notes, and snippets.

jakebathman / jsonToCsv.php
Last active Mar 4, 2021 — forked from Kostanos/json-to-csv.php
A function to convert a JSON string (or a PHP array) to a CSV file or CSV string echoed to the browser
View jsonToCsv.php
* Based on (forked from) the work by
* This revision allows the PHP file to be included/required in another PHP file and called as a function, rather than focusing on command line usage.
* Convert JSON file to CSV and output it.
* JSON should be an array of objects, dictionaries with simple data structure
jakebathman / Auto-clicker for
Last active Aug 29, 2015
Auto-clicker for /r/TheButton
View Auto-clicker for


This little script will automatically click The Button ( when the timer goes below a certain time (set by the user as intClickUnderTime).

This will only run until you refresh the page or navigate away.

⚠️ ⚠️ ⚠️


jakebathman / geoDistance.php
Last active Jul 15, 2020
Lat/Lon Distance Calculator
View geoDistance.php
* Calculate the distance between two points on a sphere
* Implements the Haversine formula:
* More advanced calculation (good for antipodal points) can be used by using
* FALSE for $boolUseHaversine. This will use another solution to the Great-circle
* ditance problem (, implementing
* the Vincenty formula (
jakebathman / map.php
Last active Aug 29, 2015
Google Maps v3 basic example
View map.php
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
jakebathman / markov.php
Last active Aug 29, 2015 — forked from bmcculley/markov.php
PHP Markov Chain class
View markov.php
Levi Thornton from boogybonbon and wordze generously posted his php Markov
Chain class.. unfortunately there is a missing $nn++ thus the class can hang,
the working version is below all credit to Levi for the code, i just fixed a
Example Usage:
View BASE64SHA1.vbs
Public Function BASE64SHA1(ByVal sTextToHash As String)
Dim asc As Object
Dim enc As Object
Dim TextToHash() As Byte
Dim SharedSecretKey() As Byte
Dim bytes() As Byte
Const cutoff As Integer = 5
Set asc = CreateObject("System.Text.UTF8Encoding")
jakebathman / StringConcat.vbs
Created Aug 18, 2015
Concatenate a range of strings in Excel, using VBA From
View StringConcat.vbs
Function StringConcat(Sep As String, ParamArray Args()) As Variant
' StringConcat
' By Chip Pearson,,
' This function concatenates all the elements in the Args array,
' delimited by the Sep character, into a single string. This function
' can be used in an array formula. There is a VBA imposed limit that
' a string in a passed in array (e.g., calling this function from
' an array formula in a worksheet cell) must be less than 256 characters.
jakebathman / botPost.php
Last active Jul 12, 2020
GroupMe bot post function including @mentions
View botPost.php
* Post a message from a bot to a group
* $groupId (string) GroupId of the group to post the message
* $strMessage (string) Text of the message to post (limit of 1000 characters)
* $strBotId (string) ID of the bot which will post the message
* $mentionUsers (array) [optional] array of userIds to mention (uses attachment)
* Example array of userIds:
jakebathman / groupMeApi.php
Last active Aug 28, 2015
GroupMe API post
View groupMeApi.php
public function apiPost($url, $data = array() , $boolHeaders = false)
$ch = curl_init($url);
if (empty($data['file']))
$data = json_encode($data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data)
View regex.php
$arrRegexPatterns = array(
'subreddit' => "/(reddit\.com|reddittryhard\.com)?(?:\/r\/){1}([\w]+)/i",
if (preg_match($arrRegexPatterns['subreddit'], $text, $arrMatches) !== false)
echo json_encode($arrMatches);