Skip to content

Instantly share code, notes, and snippets.

View vjo's full-sized avatar

Victor Jolissaint vjo

View GitHub Profile
@vjo
vjo / .vimrc
Last active August 29, 2015 14:16
Vim - Stripping whitespace
" This will work:
autocmd BufWritePre *.js,*.py :%s/\s\+$//e
" This works too:
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
endfunc

Keybase proof

I hereby claim:

  • I am vjo on github.
  • I am vjo (https://keybase.io/vjo) on keybase.
  • I have a public key whose fingerprint is 6C63 6849 090B 71C1 FEC6 1A7D C7EB D57C 78B9 9F3C

To claim this, I am signing this object:

@vjo
vjo / details_per_years.js
Last active August 29, 2015 14:05
Get how much money you already have spend on Capitainetrain.com
var t = {'total': 0, 'detail': {}};
$.each(document.getElementsByClassName('folder'),
function(k, v){
var date_str = v.getElementsByClassName('large-date')[0].title;
var year = date_str.slice(-4);
var price = parseFloat(v.getElementsByClassName('folder__price-label')[0].textContent.replace(/€/, '').replace(/ /, '').replace(',', '.'));
if(!t.detail[year]){
t.detail[year] = {'total': 0, 'tickets': []};
}
t.detail[year].tickets.push({'price': price, 'date_str': date_str});
@vjo
vjo / button_transition.html
Created July 11, 2014 10:45
Button transition inspiration
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Button hover transition</title>
<style>
/* Button / Transition inspired from http://icorinc.com */
html {
@vjo
vjo / vimrc_reload-firefox
Last active July 20, 2017 19:34
Reload Firefox current page from Vim
While developing website / webapp it's great to force your browser to reload when modifiying code.
You have plenty of solutions like LiveReload.
I wanted to be able to reload Firefox from vim and this is a simple way to achieve that:
* Install MozRepl (https://github.com/bard/mozrepl/wiki)
* Firefox > Tools > MozRepl > Start
* Be sure you have netcat 'nc' installed
* Add these line in your .vimrc:
@vjo
vjo / get_flws.sh
Created April 23, 2014 14:23
Curl and echo a followers_count from Twitter account
f=$(curl -Ls twitter.com/y3ty | grep -Po '(?<=followers_count&quot;:)[0-9]+'); echo $f
@vjo
vjo / meetup_waiting_pos.js
Last active August 1, 2016 17:38
Find your position in Meetup.com waiting list
$("#rsvp-list-waitlist h5")
.map(function(i, el) {return {"pos": i, "name": $(el).text()}})
.filter(function(i, el) {return el["name"].indexOf("Your name") >= 0;});
@vjo
vjo / template_web.html
Created March 18, 2014 13:16
Template web page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Company Homepage">
<meta name="author" content="Victor Jolissaint">
<title>Page title</title>
<link rel="author" href="humans.txt">
import re
import operator
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
d = {}
pound = 1
score = 0
str = 'Good luck in the Facebook Hacker Cup this year!'
str = str.lower()
@vjo
vjo / call_to_action.html
Last active December 26, 2015 23:48
Nice button, call to action.
<html>
<!-- From http://ionicons.com/ -->
<head>
<style>
body {
box-sizing: border-box;
padding-top: 136px;
border-top: 1px solid #4F8EF7;
color:#373737;
text-align: center;