Skip to content

Instantly share code, notes, and snippets.

@EscApp2
EscApp2 / all_order_ajax.js
Last active May 6, 2024 11:12
datalayer google analitics example
BX.namespace('BX.Sale.OrderAjaxComponent');
(function() {
'use strict';
/**
* Show empty default property value to multiple properties without default values
*/
if (BX.Sale && BX.Sale.Input && BX.Sale.Input.Utils)
{
@hexylena
hexylena / cite.py
Last active May 6, 2024 11:12
Replace \cite{10.1234/some-key} with actual citation, doi2bib must be installed.
#!/usr/bin/env python
# license: cc0/public domain
import re
import sys
import subprocess
input_file = sys.argv[1]
output_file = input_file.replace('.tex', '.bib')
with open(input_file, "r") as f:
@GabrielMMelo
GabrielMMelo / sudo-termux
Created January 22, 2019 12:33
Install sudo in Termux (Android)
apt install git
git clone https://gitlab.com/st42/termux-sudo
cd termux-sudo
cat sudo > /data/data/com.termux/files/usr/bin/sudo
chmod 700 /data/data/com.termux/files/usr/bin/sudo
@LeverOne
LeverOne / LICENSE.txt
Created October 24, 2011 04:17 — forked from jed/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <pinkoblomingo@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
@wes-o
wes-o / + set of script for converting markdown files.md
Last active May 6, 2024 11:05
the 'less' command for new views of markdown files

Using pandoc to generate new views

How to Implement

Install pandoc(https://pandoc.org/getting-started.html)

Clone this Gist find the two files: .less-filter-to-man & md-to-pdf.sh

1 Add to your /home or ~ directory. 📘

@evisotskiy
evisotskiy / smacss.txt
Last active May 6, 2024 11:04
SMACSS Property Order
# SMACSS Property Order
# http://smacss.com/book/formatting
# Box
content
display
float
flex
@evisotskiy
evisotskiy / es6-notices.js
Last active May 6, 2024 11:03
es6 features I keep forgetting
// создать массив из N элементов, и заполнить его числами от 1 до N:
[...Array(N+1).keys()].slice(1)
// деструктуризация и присваивание в уже существующие переменные:
let isOnline = true;
let isLoggedIn = false;
const data = { isOnline: false, isLoggedIn: true };
({ isOnline, isLoggedIn } = data);
# How to rebase automatically on git pull
https://dev.to/mliakos/don-t-git-pull-use-git-pull-rebase-instead-5b8k
# How to remove untraceable files
git clean -df
@evisotskiy
evisotskiy / wp-notices.php
Last active May 6, 2024 11:03
wp-notices
<?php
/***************
* set attr defer for js-scripts
***************/
add_filter( 'script_loader_tag', 'add_defer_attribute', 10, 2 );
function add_defer_attribute( $tag, $handle ) {
$scripts_to_defer = array( 'google-map', 'google-map-init' );
foreach ( $scripts_to_defer as $defer_script ) {
class Configuration {
private static $instance;
private function __construct() {/* */}
public static function getInstance() {
if (self::$instance === null) {
self::$instance = new Configuration();
}
return self::$instance;
}
public function get($key) {/* */}