Skip to content

Instantly share code, notes, and snippets.

@YuMS
YuMS / update-git.sh
Created June 29, 2016 09:28
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@mikejolley
mikejolley / gist:e73f9d061aaebd25ccdc
Created February 22, 2016 13:07
WooCommerce - Remove subtotal row.
add_filter( 'woocommerce_get_order_item_totals', 'adjust_woocommerce_get_order_item_totals' );
function adjust_woocommerce_get_order_item_totals( $totals ) {
unset($totals['cart_subtotal'] );
return $totals;
}
@schmidt1024
schmidt1024 / svg.js
Created June 3, 2015 13:59
Replace all SVG images with inline SVG using jQuery
/*
* Replace all SVG images with inline SVG
*/
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
@kouk
kouk / How to add a submodule with shallow checkout and shallow clone
Last active April 17, 2024 20:16
.How to add a submodule with shallow checkout and shallow clone
If you have a huge repository (in size and in history) and want to add a subfolder
to your project as a submodule you can follow this example to save time and space
using git's shallow clone and shallow checkout feature. It is a bit more complicated
in this example because I assume that you want your submodule to track a non-default
branch, called `mybranch`, instead of the `master` branch. Things could probably get
a lot simpler when using the default branch. After following the commands in these
examples you can use `git submodule update` and `git submodule update --remote` as normal.
@webaware
webaware / bitbucket.js
Created September 2, 2014 22:01
Some bookmarklets for setting tab-size to 4 on GitHub, Gist, and Bitbucket. NB: they all work in Chrome, but the GitHub and Gist ones don't work in Firefox (as at v31) because of its implementation for honouring CSP headers.
javascript:(function(){var style=document.createElement('style'),css=document.createTextNode('.refract-container .source{-moz-tab-size:4;tab-size:4;}');style.appendChild(css);document.getElementsByTagName('head')[0].appendChild(style);})();
@AgelxNash
AgelxNash / plugin.LoadElement.php
Last active February 8, 2022 03:39
[MODX Evolution] Плагин загрузки элементов (чанков и сниппетов) из файлов
<?php
/**
* LoadElement
*
* Загрузка элементов из файлов
*
* @version 2.0.0
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
* @category plugin
* @author Agel Nash <modx@agel-nash.ru>
@higemaru
higemaru / gist:5863873
Last active April 19, 2021 11:25
GIT_COMMITTER_DATE / GIT_AUTHOR_DATE
export GIT_COMMITTER_DATE="Fri Jun 21 20:26:41 2013 +0900"
git commit --amend --date "Fri Jun 21 20:26:41 2013 +0900" -m 'fix committer_date and author_date'
unset GIT_COMMITTER_DATE
export GIT_COMMITTER_DATE="2013-08-01 23:01:01 +0900"
git commit --amend --date "2013-08-01 23:01:01 +0900" -m 'fix committer_date and author_date'
unset GIT_COMMITTER_DATE
@jayj
jayj / flexbox.less
Last active November 20, 2023 04:51
CSS3 Flexbox - LESS Mixins
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox