Skip to content

Instantly share code, notes, and snippets.

View piouPiouM's full-sized avatar
🪄
Tweaking my Neovim configuration

Mehdi Kabab piouPiouM

🪄
Tweaking my Neovim configuration
View GitHub Profile
" vim-plug
" Press `gx` to open the GitHub URL for a plugin or a commit with the default browser.
" From https://github.com/junegunn/vim-plug/wiki/extra#gx-to-open-github-urls-on-browser
function! s:plug_gx()
let line = getline('.')
let sha = matchstr(line, '^ \X*\zs\x\{7,9}\ze ')
let name = empty(sha) ? matchstr(line, '^[-x+] \zs[^:]\+\ze:')
\ : getline(search('^- .*:$', 'bn'))[2:-2]
let uri = get(get(g:plugs, name, {}), 'uri', '')
if uri !~ 'github.com'
@piouPiouM
piouPiouM / .gitconfig
Created March 23, 2017 10:15
My Git configuration
[user]
name = Mehdi Kabab
[color]
ui = auto
[core]
excludesfile = ~/.config/git/ignore
editor = nvim
whitespace = -trailing-space
# Make `git rebase` safer on macOS
@piouPiouM
piouPiouM / SassMeister-input.scss
Last active March 25, 2016 14:19 — forked from Kozlika/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Settings
// ===========================================
$fonts-map: (
'sourcesanspro':
@piouPiouM
piouPiouM / SassMeister-input.scss
Created January 19, 2016 14:52
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
%title-alpha {
font-size: 3rem;
color: blue;
%title-rank {
color: yellow;
}
@piouPiouM
piouPiouM / countCSSRules.js
Created October 7, 2015 08:59 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
<?php
/**
* Promote the theme stylesheets.
*
* Implements hook_css_alter().
*
* @param array &$css
* An array of all CSS items (files and inline CSS) being requested on the page.
* @param array $options
* (optional) An associative array containing:
@piouPiouM
piouPiouM / SassMeister-input.scss
Created September 16, 2015 13:42
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
/* Solution 1 */
$_selectors: '';
@for $i from 1 through 12 {
$_selectors: '#{$_selectors}.truc_#{$i}';
}
@piouPiouM
piouPiouM / SassMeister-input.scss
Created February 24, 2015 10:21
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
.component {
margin-top: 10px;
@at-root .affects-component #{&} {
margin-top: 0;