Skip to content

Instantly share code, notes, and snippets.

View siriokun's full-sized avatar
Hotfixing deprecated codes

Rio Purnomo siriokun

Hotfixing deprecated codes
View GitHub Profile
@siriokun
siriokun / p.js
Last active December 22, 2018 09:35
First paragraph
var p = document.getElementsByTagName('p');
p[0].style.fontSize = '2rem';
p[0].style.fontWeight = 'bold';
@siriokun
siriokun / pull-request.md
Created December 1, 2018 08:52
How to Pull Request

In your github fork, you need to keep your master branch clean, by clean I mean without any changes, like that you can create at any time a branch from your master. Each time that you want to commit a bug or a feature, you need to create a branch for it, which will be a copy of your master branch.

When you do a pull request on a branch, you can continue to work on another branch and make another pull request on this other branch.

Before creating a new branch, pull the changes from upstream. Your master needs to be up to date.

Create the branch on your local machine and switch in this branch :

$ git checkout -b [name_of_your_new_branch]
@siriokun
siriokun / functions.php
Last active December 20, 2017 03:52
Artist post type with Topic taxonomy
// Topic Taxonomy
if ( ! function_exists( 'topic_taxonomy' ) ) {
// Register Topic Taxonomy
function topic_taxonomy() {
$labels = array(
'name' => _x( 'Topics', 'Taxonomy General Name', 'understrap' ),
'singular_name' => _x( 'Topic', 'Taxonomy Singular Name', 'understrap' ),
'menu_name' => __( 'Topics', 'understrap' ),
@siriokun
siriokun / functions.php
Created November 2, 2017 07:56 — forked from gamaup/functions.php
Reorder Checkout Fields
<?php
/* WooCommerce < 3.0.4 */
add_filter('woocommerce_checkout_fields','reorder_fields');
function reorder_fields($fields) {
$billing_field_order = array(
'billing_first_name',
'billing_last_name',
'billing_address_1',
'billing_email',
@siriokun
siriokun / functions.php
Created October 27, 2017 00:24
WordPress Custom Menu Walker for Bootstrap 4
/**
* WordPress Custom Menu Walker for Bootstrap 4.
*/
add_filter ( 'nav_menu_css_class', 'navitemclass', 10, 4 );
function navitemclass( $classes, $item, $args, $depth ){
$classes[] = 'nav-item';
return $classes;
}
img {
filter: sepia(1) hue-rotate(200deg) opacity(.85) brightness(.85);
transition: .4s;
}
img:hover {
filter: none;
}
@siriokun
siriokun / .jsbeautifyrc
Created May 30, 2017 04:49 — forked from wzup/.jsbeautifyrc
.jsbeautifyrc file example
{
// The plugin looks for a .jsbeautifyrc file in the same directory as the
// source file you're prettifying (or any directory above if it doesn't exist,
// or in your home folder if everything else fails) and uses those options
// along the default ones.
// Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options
// Documentation: https://github.com/einars/js-beautify/
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "dust"],
@siriokun
siriokun / jquery-show-nav-on-scroll.js
Created April 25, 2017 07:21
Only show navigation when scrolling
$(window).scroll(function (event) {
var scroll = $(window).scrollTop();
// Do something
if(scroll>0){
$("#nav").fadeIn("slow");
}else{
$("#nav").fadeOut("slow");
}
});