Skip to content

Instantly share code, notes, and snippets.

View equinusocio's full-sized avatar
:octocat:
Something went wrong. Try again🁢

Mattia Astorino equinusocio

:octocat:
Something went wrong. Try again🁢
View GitHub Profile
@equinusocio
equinusocio / .gitconfig
Created March 29, 2019 11:57
My global git config and aliases
[user]
name = Mattia Astorino
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[color "status"]
@equinusocio
equinusocio / purge_git_tags.sh
Created January 8, 2018 16:55
Remove all local and remote tags from git
# To delete remote tags (before deleting local tags)
git tag -l | xargs -n 1 git push --delete origin
# Delete the local copies
git tag | xargs git tag -d
@equinusocio
equinusocio / postcss-build.js
Created December 4, 2017 15:53 — forked from LasaleFamine/postcss-build.js
Building postcss files.
const fs = require('fs-extra');
const postcss = require('postcss');
const postcssrc = require('postcss-load-config');
const folder = './folder/';
const outputFolder = './out';
const run = async () => {
const files = await fs.readdir(folder);
@equinusocio
equinusocio / css_multiline_truncate.scss
Created February 14, 2017 10:56
CSS Multiline Truncate
$font-size: 26px;
$line-height: 1.4;
$lines-to-show: 3;
h2 {
display: block; /* Fallback for non-webkit */
display: -webkit-box;
max-width: 400px;
height: $font-size * $line-height * $lines-to-show; /* Fallback for non-webkit */
margin: 0 auto;
@equinusocio
equinusocio / random_segments.js
Last active July 15, 2016 12:57
Generate (on touchmove) a random colorful segment inside the canvas.
document.addEventListener('touchmove', function (e) {
e.preventDefault();
});
var c = document.getElementsByTagName('canvas')[0],
x = c.getContext('2d'),
pr = window.devicePixelRatio || 1,
w = window.innerWidth,
h = window.innerHeight,
f = 90,
q,
@equinusocio
equinusocio / osx_gem_installation.sh
Created April 6, 2016 07:56
How to install gem on OSX if you get the permission error.
sudo gem install -n /usr/local/bin package_name
$breakpoints: (
extraSmall : 30em,
small : 48em,
medium : 60em,
large : 80em,
extraLarge : 100em
);
$densities: (
1x : '96dpi',
@equinusocio
equinusocio / purge_node.txt
Last active November 6, 2018 08:04 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@equinusocio
equinusocio / fix_npm_persmissions-zsh.terminal
Last active May 26, 2017 13:03
Fix npm and node_modules permissions (without sudo)
touch ~/.npmrc
echo "prefix = ~/.local" >> ~/.npmrc
echo "export PATH=$HOME/.local/bin:$PATH" >> ~/.zshrc && echo $PATH
source ~/.zshrc