Skip to content

Instantly share code, notes, and snippets.

Development Software

  • VirtualBox - Virtualization software for running local operating systems within your computer. This allows us have a full version of linux within our computers that better match how a live webserver works.
  • Vagrant - A tool for provisioning (creating) virtual machines.
  • VVV - A pre-built, community-supported Vagrant configuration for WordPress development.
  • Git - Version control system for managing code during development. Easily allows for tracking changes, and merging new code into an existing project.
  • SourceTree - A GUI available on Windows and Mac for managing Git projects. This makes Git much easier to use, as we won't have to learn the command line interface.
  • Github.com - A website that provides free Git repositories for both open source and private projects.
  • SASS - (SCSS) A CSS preprocessing implementation that allows us to write much less CSS for a project. This basically makes CSS into a simple programming language.
@tulanght
tulanght / gulpfile.js
Created September 25, 2015 06:39 — forked from samuelhorn/gulpfile.js
My gulpfile for new projects
/*******************************************************************************
1. DEPENDENCIES
*******************************************************************************/
var gulp = require('gulp'); // gulp core
sass = require('gulp-sass'), // sass compiler
uglify = require('gulp-uglify'), // uglifies the js
jshint = require('gulp-jshint'), // check if js is ok
rename = require("gulp-rename"); // rename files
concat = require('gulp-concat'), // concatinate js
@tulanght
tulanght / gist:0df92c8c482ce6e4aa5b
Last active September 22, 2015 13:09 — forked from learncodeacademy/gist:5850f394342a5bfdbfa4
SSH Basics - Getting started with Linux Server Administration

###SSH into a remote machine###

ssh [email protected]
#or by ip address
ssh [email protected]

exit: exit ###Install Something###

#If it's a new server, update apt-get first thing

4chan Audio WebM Guide

Download FFmpeg https://www.ffmpeg.org/download.html FFmpeg is a command line tool, which means there is no GUI. You are going to have to input commands via the keyboard instead of clicking the mouse.

Current Limitations for WebM files on 4chan are:

Maximum file size is 4096KB.

Maximum duration is 300 seconds.

<?php
/**
* Remove a given term from the specified post
*
* Helper function since this functionality doesn't exist in core
*/
function my_remove_post_term( $post_id, $term, $taxonomy ) {
if ( ! is_numeric( $term ) ) {
<?php
/* This part goes in your functions.php */
/**
* Get Some Posts
*
* Use get_posts to get an array of posts matching a set of criteria.
* The category_name is passed to the function.
* get_posts uses the same parameters as WP_query. See the Codex for the full details..
* http://codex.wordpress.org/Template_Tags/get_posts

WordPress database clean up queries

Orphan rows

Since WordPress uses MyISAM for it's storage engine, we don't get foreign keys - thus orphan rows can show themselves.

wp_posts -> wp_posts (parent/child)

SELECT * FROM wp_posts
LEFT JOIN wp_posts child ON (wp_posts.post_parent = child.ID)