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 / 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 / kli_gutenberg_gallery_fix.php
Created March 20, 2018 18:37
Replace Gutenberg gallery block with the gallery shortcode.
@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

@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 / 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 / load-js-from-innerhtml.js
Created January 12, 2017 21:22
Load JS files dynamically from innerHTML
/**
*
* @type is typescript
* @td use better logic for every content load
*/
var loadJsURL = function(url) {
var canJsLoad = function(url) {
if (!url) return false;
var scripts = document.getElementsByTagName('script');
@klihelp
klihelp / test_database_connect.php
Created September 23, 2016 14:12
Test script for database MySQL / MariaDB connection.
<?php
define('DB_HOST', 'localhost');
define('DB_NAME', 'XXX');
define('DB_USER', 'XXX');
define('DB_PASSWORD', 'XXX');
// Port : 3306
$messages = array(
'no_Host' => 'Unable to Connect to "'. DB_HOST.'".',

Regarding property ordering, I have to disagree that alphabetical is the sensible route. My ordering might seem strange, but the properties are grouped and ordered by relation to one another. Given the following example:

.element {
  box-sizing: content-box;
  color: blue;
  display: block;
  font-family: "Open Sans", sans-serif;
  font-size: 13px;
  font-style: italic;