Skip to content

Instantly share code, notes, and snippets.

@Arahort
Arahort / .gitconfig
Created January 27, 2023 08:11 — forked from jvandyke/.gitconfig
Use PHPStorm/WebStorm for git diff and merge tools
# ~/.gitconfig
# Add this to your global git configuration file
# Change phpstorm to webstorm, if you use that.
# Diff and merge tool changes
# Run `git difftool <directory/file>...` or `git mergetool <directory/file>...`
[merge]
tool = phpstorm
[diff]
tool = phpstorm
@Arahort
Arahort / .gitconfig
Created January 27, 2023 08:11 — forked from jmlane/.gitconfig
Git config for PHP/WebStorm as diff and merge tool on Windows. See http://www.jetbrains.com/webstorm/webhelp/running-webstorm-as-a-diff-or-merge-command-line-tool.html for information on using the diff/merge functionality in the IDE on the command line.
# ~/.gitconfig
# Add this to your global git configuration file
# Change webstorm to phpstorm, if you use that.
# Diff and merge tool changes
# Run `git difftool <directory/file>...` or `git mergetool <directory/file>...`
[merge]
tool = phpstorm
[diff]
tool = phpstorm
@Arahort
Arahort / main.js
Created November 2, 2021 15:21 — forked from RoseCrime/main.js
Stuff I keep using over and over again
//Logging
const log = val => console.log(val),
error = message => console.error(message),
type = val => log(typeof val)
//Math
let random = (min, max) => Math.random() * (max - min + 1) + min,
floor = val => Math.floor(val),
abs = val => Math.abs(val)
<!DOCTYPE HTML>
<html prefix="og: http://ogp.me/ns#">
<head>
<title>[[*title]]</title>
<meta charset="utf-8" />
<base href="[[++site_url]]" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="[[*description]]" />
<meta name="keywords" content="[[*keywords]]" />
@Arahort
Arahort / Custom scrollbar
Created February 7, 2019 10:05
Custom scrollbar
/*Webkit scroll*/
html::-webkit-scrollbar {
width: 10px;
}
html::-webkit-scrollbar-thumb {
border-width: 1px 1px 1px 2px;
border-color: #aaa;
background-color: #2C2423;
}
html::-webkit-scrollbar-thumb:hover {
@Arahort
Arahort / Joomla category description explode
Created November 1, 2018 08:38
Joomla category description explode
<?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
<div class="category-desc clearfix">
<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
<img src="<?php echo $this->category->getParams()->get('image'); ?>" alt="<?php echo htmlspecialchars($this->category->getParams()->get('image_alt')); ?>"/>
<?php endif; ?>
<?php if ($this->params->get('show_description') && $this->category->description) : ?>
<?php
$cat_desc = JHtml::_('content.prepare', $this->category->description, '', 'com_content.category');
$cat_desc_explode = explode('<hr id="category-desc-readmore" />', $cat_desc); ?>
<div class="category-desc1">
@Arahort
Arahort / gist:7f67df2203fb1b71afd885655e144b58
Created August 24, 2018 11:54 — forked from Mikodes/gist:be9b9ce42e46c3d4ccb6
All Media queries for resolutions
/* (320x480) iPhone (Original, 3G, 3GS) */
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
/* insert styles here */
}
/* (320x480) Smartphone, Portrait */
@media only screen and (device-width: 320px) and (orientation: portrait) {
/* insert styles here */
}
@Arahort
Arahort / Menu active class
Created July 25, 2018 09:57
Add class "active" in menu
$(document).ready(() => $(`.chromestyle a[href='${location.pathname}']`).parent('li').addClass('active'))
@Arahort
Arahort / Multi-spoilers
Created July 25, 2018 09:52
Many spoilers on one page
<script>
var textBlock = $(".fs_text_block");
/*Перебераем все блоки и проверяем кол-во символов в блоке, если оно меньше 1000 скрываем спойлер*/
$(textBlock).each(function() {
var lengthTextBlock = $(this).text().length;
if (lengthTextBlock < 1000) {
$(this).parent().addClass( "low-length" );
}
})
/* Клик */
@Arahort
Arahort / Clear hash
Created June 26, 2018 13:39
Clear hash
history.pushState("", document.title, window.location.pathname);