Skip to content

Instantly share code, notes, and snippets.

View zexeder's full-sized avatar
:octocat:

Antoȵ zexeder

:octocat:
View GitHub Profile
// Convert PX to REM
$browser-context: 16; // Default
@function rem($pixels, $context: $browser-context) {
@return #{$pixels/$context}rem;
}
// Margin/Padding helpers
$step : 5;
$from : 0;
$through : ceil( 100 /$step);
@zexeder
zexeder / helpers.css
Last active November 17, 2023 09:44
scss class helpers
/* Helpers */
@font-face {
font-family: "Roboto";
src: url("../fonts/Roboto/Roboto-Regular.woff") format("woff");
font-weight: normal;
}
@font-face {
font-family: "Roboto";
src: url("../fonts/Roboto/Roboto-Bold.woff") format("woff");
if ( ! function_exists( 'function_name_given' ) ) :
/** * get the value of view. */
function function_name_given($postID) {
$count_key = 'wpb_post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count ==''){
$count = 1;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '1');
} else {
@zexeder
zexeder / caps2ctrl.reg
Created March 3, 2020 09:23
Replace CapsLock to Ctrl
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@zexeder
zexeder / popup-center.css
Created November 11, 2019 14:24
Centering popup
div {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 50%;
}
@zexeder
zexeder / .csscomb.json
Created October 21, 2019 09:00
My csscomb config
{
"exclude": ["node_modules/**"],
"always-semicolon": true,
"color-case": "upper",
"block-indent": "\t",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": false,
"leading-zero": false,
"quotes": "double",
@zexeder
zexeder / .csscomb.json
Created June 10, 2019 12:40 — forked from nrifki/.csscomb.json
My CSS Comb configuration
{
"exclude": [".git/**", "node_modules/**", "bower_components/**"],
"always-semicolon": true,
"block-indent": " ",
"color-case": "upper",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "double",
@zexeder
zexeder / getTVcustomData.php
Created February 25, 2019 09:27 — forked from pavel-one/getTVcustomData.php
Кастомные данные для тв
<?php
//@EVAL return $modx->runSnippet('getDepartament');
$pdo = $modx->getService('pdoFetch');
$pdo->setConfig(array(
'parents' => 137,
'limit' => 0,
'sortby' => 'id',
'select' => 'id,pagetitle',
'return' => 'data',
'where' => [
<?php
// $modx->log($modx::LOG_LEVEL_ERROR,'Testing my custom hook.');
$email = $hook->getValue('subscribe-email');
$base_path = $modx->getOption('base_path');
$fp = fopen($base_path . 'subscribe/subscribe_db.txt', 'a+');
$matches = false;
$lines = file($base_path . 'subscribe/subscribe_db.txt'); // reads a file into a array with the lines
foreach ($lines as $line) {
@zexeder
zexeder / convert_to_utf8.sh
Last active September 26, 2018 09:25
Recursive file convertion windows-1251 --> utf-8
# Recursive file convertion windows-1251 --> utf-8
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do
echo " $file"
mv $file $file.icv