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
const transparent = 'display: none!important;' | |
class ColorLite extends HTMLElement { | |
connectedCallback() { | |
this.card = document.createElement('ha-card'); | |
const container = document.createElement('div'); | |
this.card.appendChild(container); | |
this.card.style.background = 'none'; | |
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
#!/bin/bash | |
LIST=( | |
"stapp" | |
"stapp-formbase" | |
"stapp-loaders" | |
"stapp-persist" | |
"stapp-react" | |
"stapp-rxjs" | |
"stapp-select" |
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
/* Example #1 */ | |
// Store.js | |
// `Atom()` - create new stream | |
const a = Atom(0); | |
const b = Atom(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
function reverseString(string) { | |
var arr = new Array(string.length), | |
middle = Math.ceil(string.length / 2); | |
for (var x = 0, y = string.length - 1; x <= middle; x++, y--) { | |
arr[x] = string[y]; | |
arr[y] = string[x]; | |
} | |
return arr.join(''); |
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 | |
/** | |
* This function can be used to return (instead of echoing) results | |
* of build-in functions, that cannot return, just echo. | |
* @return mixed Results of called function. | |
*/ | |
function md_rioe() { | |
if (func_num_args() === 0) { | |
trigger_error('Nothing to call', E_USER_WARNING); |
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 | |
/** | |
* Returns urls of all sizes of the post thumbnail (featured image). | |
* @param integer $post_id Post ID | |
* @return array Key-value array of sizes and urls. | |
*/ | |
function md_post_thumbnail_urls($post_id) { | |
$thumbnail_id = get_post_thumbnail_id( $post_id ); | |
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 | |
/** | |
* Completely removes jQuery from the front. | |
*/ | |
function remove_jquery() { | |
if (!is_admin()) { | |
wp_deregister_script('jquery'); | |
wp_deregister_script('jquery-migrate'); | |
wp_register_script('jquery', '', false, '1.11.3', true); | |
wp_enqueue_script('jquery'); |
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 | |
if (!function_exists(get_excerpt_by_id)) { | |
/** | |
* Returns excerpt by ID. WP_Post->post_excerpt if it presents, wp_trim_words on other case. | |
* @param mixed $post WP_Post object or post ID. Accepts WP_Post object or post ID (integer or string); | |
* @return string Excerpt | |
*/ | |
function get_excerpt_by_id($post) { | |
$return_excerpt = function($post) { | |
if ($post->post_excerpt == '') |
NewerOlder