Skip to content

Instantly share code, notes, and snippets.

View psorensen's full-sized avatar

Peter Sorensen psorensen

  • 10up
  • United States
View GitHub Profile
@tott
tott / import-teamwork.sh
Created October 12, 2020 14:48
Get Tasks currently assigned to you from Teamwork api and import to topydo
#!/usr/bin/env bash
# Get token from edit profile API & Mobile https://developer.teamwork.com/projects/apikey/key
# Get auth string by base64 encoding <token>:<randomstring>
# https://www.base64encode.org/ can be used to create such encoded string
token=<authstring>
authString="Authorization: Basic $token"
# Get user id from your profile url (/#/people/<userid>/tasks)
userId=<userid>
@psorensen
psorensen / paginated-query.php
Created September 17, 2018 03:12
WP Paginated Query
<?php
use WP_CLI;
/**
* Paginated Query that performs callback for each iteration.
*
* @param string $callback Name of the callback function.
* @param array $args WP_Query arguments.
* @param string $message Message passed to WP CLI make_progress_bar.
@robflaherty
robflaherty / csv-to-json.php
Created September 1, 2011 02:26
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed