Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Giesbrecht NathanGiesbrecht

View GitHub Profile
@matchaxnb
matchaxnb / regenerate-images.php
Created May 20, 2015
Regenerate images in Prestashop from command line
View regenerate-images.php
<?php
define('_PS_ROOT_DIR_', '/path/to/prestashop/root');
define('_PS_ADMIN_DIR_', _PS_ROOT_DIR_.'admin_folder');
require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require(_PS_ADMIN_DIR_.'/functions.php');
class Employee2 extends EmployeeCore
{
public function isSuperAdmin()
@mildred
mildred / download.sh
Created Oct 20, 2014
Download from archive.org Wayback Machine
View download.sh
#!/bin/bash
url=http://redefininggod.com
webarchive=https://web.archive.org
wget="wget -e robots=off -nv"
tab="$(printf '\t')"
additional_url=url.list
# Construct listing.txt from url.list
# The list of archived pages, including some wildcard url
@stefanbc
stefanbc / export.php
Last active Mar 28, 2017
Export CSV from osCommerce and import it in Prestashop.Instructions:* Place the script in your osC root folder* Call the script in your browser* Save the file* Import it in Prestashop* Map the fields* Import!* You're awesome! Note: Tested with osC 2.2 rc 2a and Ps 1.5.4.1
View export.php
<?php
require('includes/application_top.php');
// Output headers so that the file is downloaded rather than displayed
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=data.csv');
// Create a file pointer connected to the output stream
$output = fopen('php://output', 'w');
@ozh
ozh / import.php
Created Apr 22, 2014
Import a CSV tweet list using Ozh' Tweet Archiver plugin
View import.php
<?php
/**
* Import a CSV tweet list
*
* Import tweets from an archive as generated by Twitter
*
* Usage :
* - Import your tweets with the plugin. The plugin will import only the 3200 most recent tweets.
* - Download your archive from Twitter, open the tweets.csv file (delete first 3200 most recent tweets to speed up things)
* - put this script and tweets.csv in WordPress' root directory (where wp-load.php is)