Skip to content

Instantly share code, notes, and snippets.

View todiadiyatmo's full-sized avatar

Todi Adiyatmo Wijoyo todiadiyatmo

View GitHub Profile
@todiadiyatmo
todiadiyatmo / javascript-object-boilerplate
Created July 15, 2014 09:40
Basic Javascript Object
var Student = (function(){
var _nim;
var _name;
function Student(nim, name){
_nim = nim;
_name = name;
}
Student.prototype.getNim(){
@todiadiyatmo
todiadiyatmo / register_post_type.php
Last active August 29, 2015 14:07
WP Register Post Type
<?php
/*
* REGISTER JOB POSTS TYPE
*/
function jobs_post_type()
{
$config = array(
'label' => __( 'Jobs', 'jobs' ),
'description' => __( 'Jobs', 'jobs' ),
@todiadiyatmo
todiadiyatmo / skill_taxonomy.php
Last active August 29, 2015 14:07
Skill Taxonomy in WordPress
<?php
/*
* Register Skill Taxonomy
*/
function create_skill_taxonomy() {
register_taxonomy(
'skills', // Taxonomy Name
array('job','resume'), // Post Type
array(
@todiadiyatmo
todiadiyatmo / get-all-terms.php
Created October 24, 2014 03:15
Get All Terms WordPress
<?php
$termArgs = array(
'orderby' => 'name',
'hide_empty' => 0
);
$skills = get_terms('skills',$termArgs );
@todiadiyatmo
todiadiyatmo / get-current-user-role.php
Last active August 29, 2015 14:09
Get Current User Role
<?php
global $current_user, $wpdb;
$role = $wpdb->prefix . 'capabilities';
$current_user->role = array_keys($current_user->$role);
$role = $current_user->role[0];
<VirtualHost *:80>
ServerName 7mcity.dev
ServerAlias *.7mcity.dev
DocumentRoot /home/todiadiyatmo/htdocs/7mcity/
RewriteEngine On
<Directory /home/todiadiyatmo/htdocs/7mcity/>
Options Indexes FollowSymLinks
AllowOverride Fileinfo Options All
Order allow,deny
ab -n <num_requests> -c <concurrency> <addr>:<port><path>
@todiadiyatmo
todiadiyatmo / xpath
Last active August 29, 2015 14:14
XPath
// Get class
$x("//h2[@class='postingtile']/text()")
/// get child of a class
$x("//div[@class='post-title']//span")
@todiadiyatmo
todiadiyatmo / prototype-js-boilerplate
Last active August 29, 2015 14:15
Javascript OOP - Prototype Boilerplate
var vehicle = {};
vehicle.drive = function () {
console.log('vrooom...');
};
// Create -> Make car "inherit" vehicle
var car = Object.create(vehicle);
car.honk = function() {
# Database
- Pastikan InnoDB
- Maria DB Engine
- https://wordpress.org/plugins/wp-optimize/ (per client approval)
# Plugin
- https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/
- Wang guard
# Backup