sublime plugins

My toolbox.

{
    "installed_packages":
    [
        "BracketHighlighter",
        "CodeFormatter",
        "ColorPicker",
        "DocBlockr",
        "Emmet",
        "Gist",
        "GitGutter",
        "HTML-CSS-JS Prettify",
        "HTML5",
        "Increment Selection",
        "Initializr",
        "JSONLint",
        "LiveStyle",
        "Phpcs",
        "Pretty JSON",
        "Sass",
        "SCSS",
        "Search WordPress Codex or QueryPosts",
        "SFTP",
        "SublimeLinter",
        "SublimeLinter-csslint",
        "SublimeLinter-html-tidy",
        "SublimeLinter-jshint",
        "SublimeLinter-php",
        "Sublimerge Pro",
        "WordPress"
    ]
}

sublime text preferences

{
	"auto_complete_selector": "source, text",
	"color_scheme": "Packages/User/Monokai (SL).tmTheme",
	"fade_fold_buttons": false,
	"font_size": 12,
	"highlight_line": true,
	"highlight_modified_tabs": true,
	"ignored_packages":
	[
		"Vintage",
		"SublimeLinter-html-tidy",
		"Phpcs"
	],
	"open_files_in_new_window": false,
	"translate_tabs_to_spaces": true,
	"word_wrap": true
}

Work, for the night is coming

“Work, for the night is coming,
Under the sunset skies;
While their bright tints are glowing,
Work, for daylight flies.
Work till the last beam fadeth,
Fadeth to shine no more;
Work, while the night is darkening,
When man’s work is o’er.”

- Anna Coghill
(John 9:4)


cmd

remove directory

rmdir folder /s/q

mailgun is the new mandrill

Tried it out on the Accezz build.

Patrick Shampine mailgun contact form tutorial.

You need to apply so anti-spam measures.

Eustasy’s tutorial even has recaptcha!


wordpress in google app engine

Following the official guide, I felt they left out some crucial points.

Prerequisites

- When setting up your Cloud SQL make sure it’s located in the same region as your App Engine instance.
- By default App Engine Instances are located in the United States.
- Add your IP address Authorized Networks in the Cloud SQL settings.
- Authorized your App Engine Application in the Cloud SQL settings.

Deploy!

- If your GAE SDK crashes when you try to connect to mySQL, just shell in then.
- mysql -uroot -p -hip address
- the root SQL password can be set in the Cloud SQL settings.

configuring email

- I installed mandrill to get around the sendmail issues.

console.developers.google.com


webfonts not working in google app engine

If your cloning the repo from the official guide and then you find your webfonts not being found (404).

Edit the following in your app.yml

- url: /wp-content/(.*\.(ico|jpg|png|gif|woff|ttf|svg))$
  static_files: wordpress/wp-content/\1
  upload: wordpress/wp-content/.*\.(ico|jpg|png|gif|woff|ttf|svg)$
  application_readable: true

gulp

  1. Goto gulp docs and follow steps.
  2. Install the packages via terminal into the root of your project. This will create a node_modules folder.
  3. Include this gulp config file into the root of project.
var gulp = require('gulp');
 
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
 
var paths = {
  scripts: ['./wp-content/themes/industry2014/js/*.js'],
  stylesheets: './wp-content/themes/industry2014/css/*.css'
};
 
// Minify and copy all JavaScript (except vendor scripts)
gulp.task('scripts', function() {
  return gulp.src(paths.scripts)
    .pipe(uglify())
    .pipe(concat('all.min.js'))
    .pipe(gulp.dest('./wp-content/themes/industry2014/js/build/'));
});
 
//minify css
gulp.task('minify-css', function() {
  gulp.src(paths.stylesheets)
    .pipe(minifyCSS(opts))
    .pipe(concat('all.min.css'))
    .pipe(gulp.dest('./wp-content/themes/industry2014/css/build/'))
});
 
// Rerun the task when a file changes
gulp.task('watch', function() {
  gulp.watch(paths.scripts, ['scripts']);
  gulp.watch(paths.stylesheets, ['minify-css']);
});
 
// The default task (called when you run `gulp` from cli)
gulp.task('default', ['scripts','minify-css','watch']);

reference


API best practices

API Writing Best Practices by Binghan

always manually output your field

meaningful resource URI
-post(c) get(r) put(u) delete(d)

Continue reading