Skip to content

Instantly share code, notes, and snippets.

View klihelp's full-sized avatar
🎯
Focusing on life and money farm

klihelp

🎯
Focusing on life and money farm
View GitHub Profile
@klihelp
klihelp / kli-wp-api-modify-post-response-fields.php
Created February 1, 2015 19:44
WP-API modify post response fields
<?php
/**
* WP-API modify post response fields
*
*/
/**
* Posts per page
*/
function kli_wp_api_query_post_per_page( $query ){
@klihelp
klihelp / wc-pagination-functions.php
Last active June 6, 2022 03:37
WooCommerce shortcode pagination on pages
<?php
/**
* Thanks for James Kemp / Iconic turning the idea into a plugin
* https://wordpress.org/plugins/shortcode-pagination-for-woocommerce
*
* This code shows pagination for WooCommerce shortcodes when it's embeded on single pages.
* Include into functions.php.
*/
if ( ! is_admin() ) {
@klihelp
klihelp / kli_gutenberg_gallery_fix.php
Created March 20, 2018 18:37
Replace Gutenberg gallery block with the gallery shortcode.
@klihelp
klihelp / app.module.ts
Last active March 24, 2021 13:41
Angular 2 - Add safeHtml for innerHTML
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { SafeHtmlPipe } from "./pipes"
@NgModule({
declarations: [
SafeHtmlPipe,
@klihelp
klihelp / kli-plugin-isolation.php
Created March 12, 2014 12:48
WordPress Plugin Isolation helper
<?php
/**
* WordPress Plugin Isolation helper
* This helps your plugin/theme to have isolated webpages, keeping only your organized prefixed hooks.
* @package Hashtagg
* @subpackage Base
* @author Klipolis
* @copyright 2014 Klipolis
* @since 0.1.0
* @version 0.1.0
@klihelp
klihelp / docker-pause-toggle.sh
Created November 8, 2018 12:57
Docker Pause Toggle
# Toggle paused status for running containers
if [[ $(docker ps -q -f status=paused | wc -l) -gt 0 ]]; then docker unpause $(docker ps -q -f status=paused); else docker pause $(docker ps -q -f status=running); fi;
@klihelp
klihelp / fill_space_up.dev.js
Last active September 18, 2018 19:35
Fill Space Up
/**
* Fill Space Up
* ver 0.1.0
*
* Repeater to fillup remaining screen space in the line.
* @TD Make it work for row and column, initial alignment of horizontally or vertically
* @TD Make calculations with js, without wrapping elements into div
*
@klihelp
klihelp / app.module.ts
Last active May 14, 2018 13:45
Angular 2 - Add safeHtml with loading scripts from innerHTML
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { CheckScriptsPipe, SafeHtmlPipe } from "./pipe.safehtml.loadJsURL.ts"
@NgModule({
declarations: [
@klihelp
klihelp / log.js
Created November 23, 2017 15:58
Log Function JS
/**
* Log Function in es6
*/
function log() {
var line = Array.prototype.slice
.call(arguments)
.map(function(argument) {
return typeof argument === 'string' ? argument : JSON.stringify(argument);
})
.join(' ');
@klihelp
klihelp / publish packages to NPM.md
Created April 22, 2017 20:22 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser