Skip to content

Instantly share code, notes, and snippets.

View svassr's full-sized avatar

Stéphane Vasseur svassr

  • Noème inc.
  • Montréal
View GitHub Profile
@svassr
svassr / config.rb
Created September 9, 2013 16:02
Compass config with CssSplitter
require 'susy'
class CssSplitter
def self.split(infile, outdir = File.dirname(infile), max_selectors = 4095)
raise "infile could not be found" unless File.exists? infile
rules = IO.readlines(infile, "}")
return if rules.first.nil?
@svassr
svassr / .vimrc
Last active August 29, 2015 14:00
vim Bundle to check and install
Bundle 'tpope/vim-fugitive' "So awesome, it should be illegal
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" vim-scripts repos
Bundle 'L9'
Bundle 'rking/ag.vim'
Bundle 'jlanzarotta/bufexplorer'
Bundle 'tpope/vim-sensible'
Bundle 'tpope/vim-surround'
function getModernViewport() {
var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
}
function getViewport() {
var viewPortWidth;
var viewPortHeight;
@svassr
svassr / osx_setup.md
Last active August 29, 2015 14:16 — forked from ruyadorno/osx_setup.md

Setup Mac OS X

This is just a personal script to help me remember all the steps required to setup a new osx machine in their correct order. I do not advise you to follow this guide if you don't know what you're doing.

Setup

1. Run software update

@svassr
svassr / no-blend.js
Created October 25, 2015 16:52 — forked from mhulse/no-blend.js
A simple JS check to see if CSS mix-blend-mode is supported.
<!doctype html>
<html class="no-blend">
<head>
<script>/* Put no-blend.js code here, sooner rather than later. */</script>
</head>
<body>
...
</body>
</html>
'use strict';
/**
* plugins to consider
* https://www.npmjs.org/package/grunt-bumper
*/
var git = require('git-rev-sync');
module.exports = function(grunt) {
@svassr
svassr / clear-that-port.sh
Created November 28, 2015 00:34
Kill everything running on a specific potrt
lsof -t -i tcp:9002 | xargs kill
@svassr
svassr / git-mv-batch.sh
Created August 25, 2016 22:17
Git mv batch of files
step1
find . -name ep06_*.jpg -exec sh -c 'FILE={}; git mv -v $FILE ${FILE/ep06_/ep08n_}' \;
#step2
find . -name ep08n_*.jpg -exec sh -c 'FILE={}; git mv -v $FILE ${FILE/ep08n_/ep03_}' \;
@svassr
svassr / emmet-hijack-fix.cson
Created October 12, 2016 15:27
Stop emmet from hijacking tab from autocomplete and snippets
# Stop emmet from hijacking tab from and autocomplete
# https://github.com/atom/autocomplete-plus/issues/86#issuecomment-82661027
'atom-text-editor.autocomplete-active:not([mini])':
'tab': 'autocomplete-plus:confirm'
# Stop emmet from hijacking tab from snippet tab stops
# https://github.com/atom/autocomplete-plus/issues/86#issuecomment-82661027
'atom-text-editor[data-grammar="text html basic"]:not([mini]), atom-text-editor[data-grammar~="jade"]:not([mini]), atom-text-editor[data-grammar~="css"]:not([mini]), atom-text-editor[data-grammar~="sass"]:not([mini]), atom-text-editor[data-grammar~="js"]:not([mini]), atom-text-editor[data-grammar~="jsx"]:not([mini])':
'tab': 'snippets:next-tab-stop'