This file contains 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
$(document).ready(function() { | |
// create canvas | |
var canvas = document.createElement("canvas"); | |
canvas.height = 300; // important! because default canvas size is 300x150 | |
var ctx = canvas.getContext('2d'); | |
// create img | |
var img = document.createElement("img"); | |
// IMPORTANT adding shadow map - each area has different background color |
This file contains 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
var Student = (function(){ | |
var _nim; | |
var _name; | |
function Student(nim, name){ | |
_nim = nim; | |
_name = name; | |
} | |
Student.prototype.getNim(){ |
This file contains 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 | |
/* | |
* REGISTER JOB POSTS TYPE | |
*/ | |
function jobs_post_type() | |
{ | |
$config = array( | |
'label' => __( 'Jobs', 'jobs' ), | |
'description' => __( 'Jobs', 'jobs' ), |
This file contains 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 | |
/* | |
* Register Skill Taxonomy | |
*/ | |
function create_skill_taxonomy() { | |
register_taxonomy( | |
'skills', // Taxonomy Name | |
array('job','resume'), // Post Type | |
array( |
This file contains 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 | |
// Init new Role and add all capability to editor and admin | |
function custom_post_type_capability_admin() | |
{ | |
// List the role that we want to give a full access | |
$roles = array('editor','administrator'); | |
// List of the post type that will have custom capability |
This file contains 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 | |
$termArgs = array( | |
'orderby' => 'name', | |
'hide_empty' => 0 | |
); | |
$skills = get_terms('skills',$termArgs ); |
This file contains 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 | |
global $current_user, $wpdb; | |
$role = $wpdb->prefix . 'capabilities'; | |
$current_user->role = array_keys($current_user->$role); | |
$role = $current_user->role[0]; |
This file contains 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
<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 |
This file contains 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
ab -n <num_requests> -c <concurrency> <addr>:<port><path> |
This file contains 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
// Get class | |
$x("//h2[@class='postingtile']/text()") | |
/// get child of a class | |
$x("//div[@class='post-title']//span") |
OlderNewer