Skip to content

Instantly share code, notes, and snippets.

Avatar
✌️

Pierre Bertet bpierre

✌️
View GitHub Profile
@bpierre
bpierre / README.md
Last active Jan 14, 2021
Switch To Vim For Good
View README.md

Switch To Vim For Good

NOTE: This guide has moved to https://github.com/bpierre/switch-to-vim-for-good

This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about how I switched myself.

My decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.

Original gist with comments: https://gist.github.com/bpierre/0a0025d348b6001394e0

@bpierre
bpierre / anchor-select.js
Created May 8, 2012
CSS Selectors anchors: /mypage.html#anchor-select(#content > h1)
View anchor-select.js
(function(window) {
function getSelector(hash) {
var matches;
hash = hash.slice(1);
matches = hash.match(/^anchor-select\((.+)\)$/);
if (matches) {
return decodeURIComponent(matches[1]);
}
return false;
@bpierre
bpierre / Makefile
Created Nov 5, 2011
A Makefile to concatenate / minify my JS Scripts and convert/compress my Stylus (CSS preprocessor) files
View Makefile
# JS files
JS_FINAL = js/project-name-all.js
JS_TARGETS = js/file1.js \
js/file2.js \
js/file3.js
# CSS files
CSS_FINAL = css/project-name-all.css
STYLUS_TARGETS = css/file1.styl \
@bpierre
bpierre / gist:4991393
Created Feb 19, 2013
Results of the markdown-testsuite with markdown-js
View gist:4991393
not ok test/markdown-testsuite.t.js .................. 51/102
Command: "node" "markdown-testsuite.t.js"
TAP version 13
ok 1 2-paragraphs-hard-return-spaces
ok 2 2-paragraphs-hard-return
ok 3 2-paragraphs-line-returns
ok 4 2-paragraphs-line-spaces
ok 5 2-paragraphs-line-tab
ok 6 ampersand-text-flow
ok 7 ampersand-uri
@bpierre
bpierre / sfrbox-host.sh
Created Dec 3, 2012
Add a custom domain on a Neuf/SFR Box, from CLI
View sfrbox-host.sh
#!/bin/sh
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 2 ] || die "2 arguments required (IP and Domain), $# provided"
LOGIN="admin"
@bpierre
bpierre / kib.js
Created Nov 14, 2012
Another boring keyboard library
View kib.js
/*jshint browser:true */
(function(name, definition) {
if (typeof define == 'function') {
define(definition);
} else if (typeof module != 'undefined') {
module.exports = definition();
} else {
this[name] = definition();
}
})('kib', function(){
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SUPER #7</title>
<style>
html { display: table; width: 100%; height: 100%; background: #000; }
body { display: table-cell; vertical-align:middle; text-align:center; margin: 0; }
canvas { margin: 0; }
h1 { color: #fff; margin: 0 0 10px; font:24px sans-serif; }
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Clock demo</title>
<style>
svg {
display: block;
position: absolute;
left: 50%;
@bpierre
bpierre / eternal-ff.txt
Created Sep 21, 2012
My Twitter followings
View eternal-ff.txt
@BKcore
@codylindley
@KerbalSpaceP
@GilbertWehrle
@dlctbl
@FREE_FACTS
@tabatkins
@marijnjh
@rocket2guns
@stripe
View parseurl.js
/*
ParseURL by James Padolsey: http://james.padolsey.com/javascript/parsing-urls-with-the-dom/
*/
// This function creates a new anchor element and uses location
// properties (inherent) to get the desired URL data. Some String
// operations are used (to normalize results across browsers).
function parseURL(url) {
var a = document.createElement('a');