This file contains hidden or 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
# | |
# About | |
# -------------------------------------------------- | |
# This script can: | |
# - Install a clean WordPress | |
# - Compile SASS | |
# | |
# Requirements | |
# -------------------------------------------------- |
This file contains hidden or 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 $category_id = get_cat_ID('Your Category'); ?> | |
<form id="yourformid" method="get" action="<?php bloginfo('url'); ?>"> | |
<input type="text" name="s" id="s" size="20" placeholder="Search" /> | |
<input type="hidden" name="cat" value="<?php echo $category_id; ?>" /> | |
<input type="submit" value="Search" /> | |
</form> |
This file contains hidden or 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
// Load dependencies | |
var gulp = require('gulp' ), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
livereload = require('gulp-livereload'), | |
sourcemaps = require('gulp-sourcemaps'); | |
// Config variables | |
var config = new (function(){ | |
this.package = 'wp-content/themes/your-theme-name/', |
This file contains hidden or 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
alias trash="rm -rf ~/.Trash" | |
alias sites="cd ~/Sites" | |
alias cc="rm -rf var/cache var/full_page_cache var/session" | |
alias apache="sudo apachectl restart" | |
alias brup="brew update && brew upgrade && brew cleanup && brew prune && brew doctor" | |
alias wordpress="wget http://wordpress.org/latest.tar.gz" | |
alias wp-cleanup="tar --strip-components=1 -xzvf latest.tar.gz && trash latest.tar.gz" | |
alias gut="git" |
This file contains hidden or 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 | |
// Add your post types to the array | |
$posttypes = array('post_type_1','post_type_3','post_type_3'); | |
$randompost_typs = shuffle($posttypes); | |
$counter = count($posttypes); | |
// Add or remove additional post types as needed | |
for($i=0; $i<$counter;$i++) { | |
if($randompost_typs[$i]=='post_type_1') { | |
// I only wanted one post from each, but you can raise or lower the value if needed | |
$posts_per_page = 1; |
This file contains hidden or 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
USER="root" | |
PASSWORD="" | |
OUTPUT="/Users/yourusername/Sites" | |
ExcludeDatabases="Database|information_schema|performance_schema|mysql|sys" | |
databases=`mysql -u $USER -p$PASWORD -e "SHOW DATABASES;" | tr -d "| " | egrep -v $ExcludeDatabases` | |
for database in $databases; do | |
echo "Dumping database: $database" | |
mysqldump -u $USER -p$PASSWORD --databases $database > `date +%Y%m%d`.$database.sql | gzip $OUTPUT/`date +%Y%m%d`.$database.sql |
This file contains hidden or 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
SET FOREIGN_KEY_CHECKS=0; | |
-- Customers | |
TRUNCATE `customer_address_entity`; | |
TRUNCATE `customer_address_entity_datetime`; | |
TRUNCATE `customer_address_entity_decimal`; | |
TRUNCATE `customer_address_entity_int`; | |
TRUNCATE `customer_address_entity_text`; | |
TRUNCATE `customer_address_entity_varchar`; | |
TRUNCATE `customer_entity`; |
This file contains hidden or 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
// PUT https://yourstorename.myshopify.com/admin/products/#{id}.json | |
{ | |
"product": { | |
"metafields": [{ | |
"namespace": "your_namespace", | |
"key": "your_key", | |
"value": "your_value", | |
"value_type": "string" | |
}, | |
{ |
This file contains hidden or 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
{% assign reorder_url = "" %} | |
{% for line_item in order.line_items %} | |
{% capture reorder_url %}{{ reorder_url | append: line_item.variant_id | append: ':' | append: line_item.quantity | append: ',' }}{% endcapture %} | |
{% endfor %} | |
<a href="{{ '/cart/' | append: reorder_url }}" class="btn">reorder</a></td> |
OlderNewer