Skip to content

Instantly share code, notes, and snippets.

@CosAnca
CosAnca / baseline-grid.scss
Created March 22, 2017 20:33 — forked from MikeAM/baseline-grid.scss
Pure-CSS baseline grid with easily-customizable column count and baseline size (using Sass). No more uploading background images!
/* Sass Mixin that generates a Baseline Grid */
/* by: Mike Morrison, Soholaunch.com */
/* You don't have to leave this credit comment in, but it would be nice of you. */
// Set your grid dimensions here
$body-width: 960px;
$baseline: 22px;
@mixin baseline-grid {
$columns: 16;
$column-color: rgba(200,0,0,.2);
@CosAnca
CosAnca / git-loglive
Created March 17, 2017 23:04 — forked from tlberglund/git-loglive
Log Live Git Command
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
@CosAnca
CosAnca / gist:2c8ff479bc6854f8c6f4700d80d98e67
Created January 23, 2017 15:19 — forked from learncodeacademy/gist:5850f394342a5bfdbfa4
SSH Basics - Getting started with Linux Server Administration

###SSH into a remote machine###

ssh user@mydomain.com
#or by ip address
ssh user@192.168.1.1

exit: exit ###Install Something###

#If it's a new server, update apt-get first thing
@CosAnca
CosAnca / ohmyzsh-dropbox-sync.sh
Created September 13, 2016 08:13 — forked from robbyrussell/ohmyzsh-dropbox-sync.sh
Keep your @ohmyzsh ~/.zshrc in sync via dropbox
# Was asked how I keep my zshrc config sync'd between my computers with Dropbox
# Add a new directory in your Dropbox (or use an existing one)
mkdir -p ~/Dropbox/ohmyzsh
# move existing file to Dropbox
mv ~/.zshrc ~/Dropbox/ohmyzsh/zshrc
# symlink file back to your local directory
ln -s ~/Dropbox/ohmyzsh/zshrc ~/.zshrc
@CosAnca
CosAnca / _baseline.scss
Created March 16, 2016 16:55 — forked from razwan/_baseline.scss
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
@CosAnca
CosAnca / bg-image-url.js
Created March 10, 2016 13:07 — forked from radist2s/bg-image-url.js
Returns background image url or empty string if doesn't exists. (jQuery isn't required)
function getBgImageUrl($el) {
var el = $el instanceof HTMLElement ? $el : ($el instanceof window.jQuery && $el.get(0))
if (!el) {
return ''
}
var backgroundImage = getComputedStyle(el).backgroundImage
if (!backgroundImage || backgroundImage === 'none') {
@CosAnca
CosAnca / gist:70b83eaaf882660d8ad0
Created March 8, 2016 13:05
Force git to use https:// instead of git://
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
More details here: https://github.com/npm/npm/issues/5257#issuecomment-60441477
@CosAnca
CosAnca / random-non-overlapping-position.js
Created November 24, 2015 16:42 — forked from magicznyleszek/random-non-overlapping-position.js
JavaScript -- get random non-overlapping position
// declarations
var positions = [];
// Returns a random integer between min (included) and max (excluded)
// Using Math.round() will give you a non-uniform distribution!
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
// generate random positions
@CosAnca
CosAnca / git-log-to-tsv.sh
Last active September 9, 2015 12:59 — forked from pwenzel/git-log-to-tsv.sh
Git Log to Tab-Delimited CSV File
# Local Dates:
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
# ISO Dates:
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt