Skip to content

Instantly share code, notes, and snippets.

footer.footer
.wrapper.footer__wrapper
.footer__col
.footer__head
.footer__payment
.footer__info
.footer__col
- var menu = content.index.menu
each items in menu.items
@Security2431
Security2431 / modx
Last active May 28, 2018 11:20
modx feature
1. anchor scroll
`<a href="[[~[[*id]]]]#anchor[[+idx]]" class="sv-list__link" data-scroll-to>[[+city]]</a>`
`[[~[[*id]]]]` - link of current page;
`[[+idx]]` - order, starting with 1;
2. anchor links `[[!++site_url]]category/[[*alias]]/#review`
useful resources:
var $price = $(".woocommerce-Price-amount");
$price.each(function(index, item) {
var $this = $(item);
var text = $this.clone().children().remove().end().text();
var $currency = $this.find(".woocommerce-Price-currencySymbol");
$this.html(Number(text.replace(/[^0-9\.-]+/g,""))).append($currency);
});
1. Сетка bootstrap 12 колоночная
2. Задание дефолтных стилей для типографии h1-h6, p, ul, ol,
3. Верстка дополнительных страниц: search, special, cart, ...
4.
@Security2431
Security2431 / thousend prettify
Created April 25, 2018 06:40
Thousends prettify separator
prettify(num) {
const n = num.toString()
return n.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + " ")
},
@Security2431
Security2431 / select-reset.css
Created August 22, 2018 13:20
Reset css style for select Element!
select {
background: #fff;
border: 1px solid #eee;
border-radius: 3px;
padding: 3px 22px 3px 3px;
background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M7.406 7.828l4.594 4.594 4.594-4.594 1.406 1.406-6 6-6-6z'%3E%3C/path%3E%3C/svg%3E");
background-position: calc(100% - 3px) 50%;
background-repeat: no-repeat;
background-size: 16px;
-webkit-appearance: none;
@Security2431
Security2431 / TSLInt-Prettier-CreateReactApp-TypeScript-setup.md
Created May 30, 2019 09:30 — forked from rimatla/TSLInt-Prettier-CreateReactApp-TypeScript-setup.md
Create React App + TypeScript Linting with TSLint and Prettier setup for on VSCode

Ps: The current setup was done on 01-04-19

Project Dependency Versions at the time 👇

  "react": "^16.7.0",
  "react-dom": "^16.7.0",
  "react-scripts": "2.1.3",
  "typescript": "^3.2.2"
  "tslint": "^5.12.0",
  "tslint-config-prettier": "^1.17.0",
@Security2431
Security2431 / .eslintrc.js
Created July 11, 2019 19:28
Eslint settings
module.exports = {
parser: 'babel-eslint',
extends: ['airbnb'],
plugins: ['prettier'],
env: {
browser: true,
},
rules: {
'react/jsx-filename-extension': 'off',
'linebreak-style': 0,
@Security2431
Security2431 / actions_clients.js
Created July 14, 2019 13:20
React-redux environment
/* src/actions/clients.js */
import * as types from '../constants/chats'
import callApi from '../utils/call-api'
export function fetchAllClients() {
return (dispatch) => {
dispatch({
type: types.FETCH_ALL_CHATS_REQUEST,
@Security2431
Security2431 / register-sw.js
Created July 18, 2019 08:33 — forked from jeffposnick/register-sw.js
A modern-ish SW registration script, detecting various state changes.
if ('serviceWorker' in navigator) {
window.addEventListener('load', async function() {
const registration = await navigator.serviceWorker.register('/service-worker.js');
if (registration.waiting && registration.active) {
// The page has been loaded when there's already a waiting and active SW.
// This would happen if skipWaiting isn't being called, and there are
// still old tabs open.
console.log('Please close all tabs to get updates.');
} else {
// updatefound is also fired for the very first install. ¯\_(ツ)_/¯