Skip to content

Instantly share code, notes, and snippets.

@apotashov
apotashov / git-aliases.md
Last active May 7, 2021 14:23 — forked from tyomo4ka/git-aliases.md
GIT: The Ultimate Alias Setup on OS X (brew)

The Ultimate Git Alias Setup on OS X (brew)

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bash_profile
@apotashov
apotashov / gulpfile.js
Last active May 7, 2021 13:12 — forked from youknowriad/gulpfile.js
Gulp: ES6 + ES5 Workflow
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var del = require('del');
var source = require('vinyl-source-stream');
var _ = require('lodash');
var extReplace = require('gulp-ext-replace');
var less = require('gulp-less');
var gulpMerge = require('merge-stream');
var ngTemplates = require('gulp-ng-templates');
@apotashov
apotashov / gulpfile.js
Last active May 7, 2021 12:45 — forked from jeromecoupe/gulpfile.js
Gulp: Responsive image pipeline
"use strict";
// ---------------------------------------
// packages
// ---------------------------------------
const del = require("del");
const deleteEmpty = require("delete-empty");
const globby = require("globby");
const gulp = require("gulp");
@apotashov
apotashov / sassy-shapes.scss
Last active May 7, 2021 14:25 — forked from una/sassy-shapes
CSS: Sassy Shape Machine Mixin :)Make Sassy shapes in seconds!
// Some cute colors:
$color1: #967bd3;
$color2: #c8815b;
$color3: #8cd6d8;
$color4: #bee6b6;
$color5: #dd9bb9;
$color6: #c4b5e6;
$color7: #cb6363;
//Here's where you make the shapes!
@apotashov
apotashov / mixins.scss
Last active May 7, 2021 14:17 — forked from infinitystylish/mixins.scss
CSS: SASS: Mixins
// Mixin navigation-list
// For this mixin we need
// <nav>
// <ul id="nav">
// <li>
// <a href="#">Uno</a>
// <li>
// <a href="#">Dos</a>
// </li>
// </ul>
@apotashov
apotashov / sup.scss
Last active May 7, 2021 14:28
CSS <sup> underline fixes
/* HOTFIX with border */
a {
border-bottom: 0.1em solid rgba(0, 155, 201, 0);
&:focus,
&:hover {
border-bottom: 0.1em solid rgba(0, 155, 201, 1);
text-decoration: none !important;
}
}
@apotashov
apotashov / HOOK_mail.php
Last active July 18, 2019 17:54
HOOK_mail
<?php
/**
* Implements hook_mail().
*/
function HOOK_mail($key, &$message, $params) {
switch ($key) {
case 'submission':
// Set mail headers.
$headers = array(
@apotashov
apotashov / dynamic_svg.php
Last active July 18, 2019 17:55
Drupal: Add dynamic height for SVG image only for IE11 on win7
<?php
/**
* Add dynamic height for SVG image only for IE11 on win7.
* @type {{attach: attach}}
*/
Drupal.behaviors.dynamicSvgSize = {
attach: function (context) {
// Get user Agent Info.
const userAgentInfo = navigator.userAgent;
@apotashov
apotashov / symbols.php
Last active May 7, 2021 14:24
Drupal: Wrap copyright symbol to superscript, across all site
<?php
/**
* Implements hook_page_alter().
*/
function THEMENAME_page_alter(&$page) {
// Wrap copyright symbol to superscript, across all site.
if (theme_get_setting('chantix_super_scripted_copy_and_trade')) {
$page['#post_render'][] = '_chantix_superscripted_copyright';
}