This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace ProcessWire; | |
/** | |
* | |
* Import images from a CSV from WP (or wherever). | |
* In this case CSV has image path and page alias. | |
* | |
*/ | |
include("index.php"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Calculate reading time on page save. | |
* Add this to your ready.php file. | |
* Uses a field called 'article_read_time' to store the value | |
* and the field 'page_content' as the readable content. | |
* You'll need to update those field names if yours are different. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Read a CSV file of URLS then use curl | |
* to check their http code and dump it all | |
* out in a table. | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace ProcessWire; | |
/** | |
* 201105 | |
* | |
* Quick script to read in a CSV of users and create | |
* users in ProcessWire's LoginRegisterPro module. | |
* Place this in the root of your PW install and then open /user_import.php | |
* Yeah - sure it could be done in a shell script or in Tracy but this is | |
* pretty simple. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
COMPRESS=1 # Compress if ImageOptim is intalled. 0 = disabled; 1 = enabled | |
iOSSubdir="/ios" # make this an empty string to save in same dir | |
androidSubdir="/android" # make this an empty string to save in same dir | |
help() { | |
echo "" | |
echo "Usage: ./$(basename "$0") <your_1024x1024.png>" | |
echo " --------------------------------------------------------------------------------------" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tag for a soundcloud html5 player | |
$scCode=$params['code']; | |
echo '<iframe width="100%" height="132" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/' . $scCode . '&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false&visual=true"></iframe>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//lord I hate apple. | |
//if git complains about not being able to merge binary file . DS_Store then run | |
git rm --cached .DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb logcat CordovaLog:D *:S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// write out an embed tag for a youtube vid. | |
$ytCode=$params['code']; | |
if(isset($params['height'])){ | |
$height=$params['height']; | |
}else{ | |
$height=290; | |
} | |
if(isset($params['width'])){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//general case is: | |
update table set column = convert(binary column using utf8); | |
// if we've just moved a cmsms db then this is a good start | |
// but you'll have to do any module specific bits. | |
update cms_content_props set content = convert(binary content using utf8); | |
update cms_htmlblobs set html = convert(binary html using utf8); | |
update cms_module_news set news_data = convert(binary news_data using utf8); |
NewerOlder