Skip to content

Instantly share code, notes, and snippets.

@srhise
srhise / WP_Meta_Query
Created January 7, 2014 02:33
Wordpress Query Examples
$meta_query_args = array(
'relation' => 'OR', // Optional, defaults to "AND"
array(
'key' => '_my_custom_key',
'value' => 'Value I am looking for',
'compare' => '='
)
);
$meta_query = new WP_Meta_Query( $meta_query_args );
@srhise
srhise / get_post
Created January 29, 2014 20:06
get_post()
<?php
$post_7 = get_post(7, ARRAY_A);
$title = $post_7['post_title'];
?>
@srhise
srhise / package.json
Created January 30, 2014 00:59
Grunt package.json example
{
"name" : "MyTestProject",
"title" : "test",
"version" : "1.0.0",
"devDependencies": {
"grunt": "0.4.1",
"grunt-contrib-concat": "0.1.3",
"grunt-contrib-cssmin" : "0.6.1",
"grunt-contrib-watch" : "0.5.3",
"grunt-contrib-uglify" : "0.2.0"
@srhise
srhise / Gruntfile.js
Created January 30, 2014 01:00
Simple Grunt Setup (2 Files)
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
css: {
src: [
'css/*'
],
dest: 'combined.css'
},
@srhise
srhise / GruntFile-moduleexports.js
Created January 30, 2014 01:03
Grunt module.exports
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', [ 'concat:css', 'cssmin:css', 'concat:js', 'uglify:js' ]);
# Edit PHP.INI
cd /etc/php5/apache2
sudo vi php.ini
# Restart Apache
sudo service apache2 restart
# param'd'#
mysql -h {hostname} -u {username}
# example #
mysql -h localhost -u root
@srhise
srhise / SSH Upload
Last active August 29, 2015 14:06
Upload file via SSH
scp file-name.tar.gz user@xx.x.x.xx:/var/www
@srhise
srhise / remove non empty directory
Created September 9, 2014 13:57
SSH - Remove non empty directory
rm -rf <folder-name>