Skip to content

Instantly share code, notes, and snippets.

View netdesignr's full-sized avatar
🎯
@(^-^)@

Mihai Diaconita netdesignr

🎯
@(^-^)@
View GitHub Profile
@netdesignr
netdesignr / gist:3070f7f77bc14a5f7f57e72106d914a5
Created June 3, 2017 16:21
Remove Wordpress toolbar the easy way
add_filter('show_admin_bar', '__return_false');
@netdesignr
netdesignr / gist:fa54bedd5ae4ebee89dc5bba64db0f08
Created June 3, 2017 17:12
Remove admin toolbar for all users except for Administrators
// Remove admin toolbar for all users except for Administrators
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
add_action('after_setup_theme', 'remove_admin_bar');
@netdesignr
netdesignr / Outdated-npm-version-in-Travis-CI-eslint-babel
Created July 6, 2017 09:05
Outdated npm version in Travis CI - eslint - babel
before_install:
- curl -s -o $HOME/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/v0.31.0/nvm.sh
- source $HOME/.nvm/nvm.sh
- nvm install stable
- node --version
@netdesignr
netdesignr / Check-if-shortcode-exists-in-page-and-echo-something
Last active July 6, 2017 13:12
Check if short-code exists in page and echo something inside Wordpress dashboard
/**
* Check if shortcode exists in page and echo something in Wordpress dashboard
*/
function check_if_shortcode_exists_in_page_and_echo_something()
{
global $post;
if (function_exists('get_current_screen')
&& function_exists('has_shortcode')
&& function_exists('is_admin')
) {
@netdesignr
netdesignr / Output each-category-followed-by-a-comma
Created July 6, 2017 16:16
Get Wordpress categories of the post and output each category with no link the attached followed by a comma
/**
* Get categories of the post
* Remove the links
* Output each category followed by a comma
* Comma is not added on the last item
* @param $arr e.g. get_the_category()
*/
function get_cat_profile($arr)
{
$counter = 0;
@netdesignr
netdesignr / currency_list_of_the_world_plain.text
Last active January 28, 2018 14:26
ISO code currency list of the world in plain text
AED
AFN
ALL
AMD
ANG
AOA
ARS
AUD
AWG
AZN
@netdesignr
netdesignr / country_list.txt
Created January 28, 2018 20:49
Country list in plain text
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@netdesignr
netdesignr / auto_make_list.txt
Created April 1, 2018 13:54
Auto make list
Acura
Aixam
Alfa Romeo
Alta
Aro
Aston Martin
Audi
Austin
Bentley
BMW
# create working directory from trunk
svn checkout http://somedomain.com/repo/trunk
# create a branch
svn copy http://somedomain.com/repo/trunk \
http://somedomain.com/repo//branches/feature-do-awesome-thing \
-m "Created branch to implement feature do awesome thing."
# switch working copy
svn switch ^/repo/branches/feature-do-awesome-thing
@netdesignr
netdesignr / README.md
Created June 6, 2018 11:37 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})