This file contains hidden or 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
{ | |
"Alexey's Functional Component": { | |
"prefix": ["afc"], | |
"body": [ | |
"import classes from './index.module.scss';", | |
"import { FC } from 'react';", | |
"", | |
"interface I${TM_DIRECTORY/.*\\\\(.*)$/$1/} {", | |
"}", | |
"", |
This file contains hidden or 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 | |
/* | |
* Create an admin user silently | |
*/ | |
add_action('init', 'agk_add_admin_user'); | |
function agk_add_admin_user() { | |
$username = 'username123'; | |
$password = 'pasword123'; |
This file contains hidden or 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
# ignore everything in the root except the "wp-content" directory. | |
/* | |
!.gitignore | |
!wp-content/ | |
# ignore everything in the "wp-content" directory, except: | |
# "mu-plugins", "plugins", "themes" directory | |
wp-content/* | |
!wp-content/mu-plugins/ | |
!wp-content/plugins/ |
This file contains hidden or 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
html, body { height: 100%; } | |
.container { | |
position: relative; | |
text-align: center; | |
display: block; | |
height: 100%; | |
&::before, | |
.box { |
This file contains hidden or 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 strip-unit($num) { | |
@return $num / ($num * 0 + 1); | |
} | |
@mixin rem2px($property, $values...) { | |
$max: length($values); | |
$pxValues: ''; | |
$remValues: ''; | |
@for $i from 1 through $max { |
This file contains hidden or 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 | |
/** | |
* Translations in Child Theme! | |
*/ | |
if (!function_exists('agk_reload_child_theme_domain')) { | |
function agk_reload_child_theme_domain($domain) | |
{ | |
$path = get_stylesheet_directory() . '/languages/'; | |
$mofile = $path . $domain . '-' . get_locale() . '.mo'; | |
if (is_readable($mofile)) { |
This file contains hidden or 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 | |
function do_slug($text, $lower = true, $strip_underscores_and_dots = true, $connector = '-') { | |
$text_accents = array( | |
// Numeric characters | |
'¹' => 1, | |
'²' => 2, | |
'³' => 3, | |
// Latin | |
'°' => 0, |
This file contains hidden or 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 | |
/** | |
* ----------------------------------------------------------------------------------------- | |
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php` | |
* ----------------------------------------------------------------------------------------- | |
*/ | |
// HTML Minifier | |
function minify_html($input) { |
This file contains hidden or 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
Requests = { | |
QueryString : function(item){ | |
var svalue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)","i")); | |
return svalue ? svalue[1] : svalue; | |
} | |
} | |
//usage | |
Requests.QueryString("id"); |
NewerOlder