git config --global --edit
# This is Git's per-user configuration file.
[user]
name = Your Work Name
email = user@workemail.com
| <?php | |
| /* Thanks to http://steindom.com/articles/shortest-php-code-convert-csv-associative-array */ | |
| ini_set('auto_detect_line_endings', TRUE); | |
| $rows = array_map('str_getcsv', file('myfile.csv')); | |
| $header = array_shift($rows); | |
| $csv = array(); | |
| foreach ($rows as $row) { |
| <?php | |
| // Thanks to netcarver > https://processwire.com/talk/topic/7803-implement-array-chunk/?p=75573 | |
| $items = $pages->find('#whatever'); // Find your stuff | |
| $parts = 3; // How many items should there be in 1 chunk? | |
| $chunked = array_chunk($items->getArray(), $parts); | |
| foreach ($chunked as $chunk) { | |
| foreach ($chunk as $item) { |
| <?php | |
| for ($i = 1; $i <= 20; $i++) | |
| { | |
| $title = file_get_contents("http://loripsum.net/api/1/plaintext/long/prude/"); | |
| $body = file_get_contents("http://loripsum.net/api/3/decorate/link/ul/prude/long/"); | |
| $template = "INSERT_TEMPLATE_HERE"; // i.e. 'basic-page' | |
| $parent = "INSERT_PARENT_HERE"; // i.e. /about-us/ | |
| $c = new Page(); |
| <?php | |
| // Bootstrap ProcessWire | |
| include 'index.php'; | |
| // Process CSV | |
| $rows = array_map('str_getcsv', file('fields.csv')); | |
| $header = array_shift($rows); | |
| $fields = array(); | |
| foreach ($rows as $row) { |
| <?php | |
| // Forgot where this came from | |
| function rand_date($min_date, $max_date) { | |
| $min_epoch = strtotime($min_date); | |
| $max_epoch = strtotime($max_date); | |
| $rand_epoch = rand($min_epoch, $max_epoch); |
| <?php namespace ProcessWire; | |
| include('index.php'); | |
| /** | |
| * CSV format | |
| * | |
| * title,datetime_matching_date,page_matching_person | |
| * 464,12/24/2014,1132 | |
| * 1750,5/9/2016,1132 |