Skip to content

Instantly share code, notes, and snippets.

View lleixat's full-sized avatar
🎯
Focusing

Tom L. lleixat

🎯
Focusing
  • Suricats Consulting
  • Toulouse
  • 18:25 (UTC +01:00)
  • X @l3x_
View GitHub Profile
@lleixat
lleixat / duplicate_line.vim
Last active October 3, 2017 09:04
[#vim] duplicate current line/block for edition
" ----------------------------------------------------------------------------
" Comment line/block and copy it for edition {{{
" ----------------------------------------------------------------------------
func! Duplicate(line1, line2, ...)
let comment_string = strlen(&commentstring) > 3 ? '#' : substitute(&commentstring, '\([^ \t]*\)\s*%s.*', '\1', '')
let lines = getbufline('%', a:line1, a:line2)
call inputsave()
let duplicate_tag_name = input("Enter tag name (default 'tag'): ")
call inputrestore()
@lleixat
lleixat / per_project_ansible_vault_file.md
Last active July 20, 2017 07:57
Per project Ansible vault file (Ansible 1.7+)

Per project Ansible vault file (Ansible 1.7+)

Use global env var to define your default vault_pass.txt file :

$ export ANSIBLE_VAULT_PASSWORD_FILE=$HOME/bin/ansible_vault_pass.sh

or add this line to your ~/.{z,ba,da,}shrc file.

@lleixat
lleixat / bash_to_zsh_history.rb
Created October 12, 2016 07:59 — forked from goyalankit/bash_to_zsh_history.rb
Import bash history to zsh history.
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = Author: Ankit Goyal
#################################################################
# change if you don't use default values
@lleixat
lleixat / gitflow-breakdown.md
Created June 9, 2016 07:32 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

-- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le : Lun 03 Août 2015 à 17:58
-- Version du serveur: 5.5.43
-- Version de PHP: 5.5.27-1+deb.sury.org~precise+1
SET FOREIGN_KEY_CHECKS=0;
@lleixat
lleixat / root test
Created June 14, 2013 15:49
Permet de tester si l'utilisateur courant est root ou exit
#!/bin/sh
## Detect good root euid or exit
if [ "$(id -u)" != 0 ]; then
echo "This script must be run as root" 2>&1
exit 1
fi
@lleixat
lleixat / nkgoogle.xml
Last active December 13, 2015 16:59
Google search : dha North Korea way
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>NKGoogle</os:ShortName>
<os:Description>Search With google [north korea way]</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/gif,GIF89a%40%00%40%00%E7%FF%00%5D%0B%18p%08%1AT%10%1E%84%04%18k%0C%1F%7D%0D%1CN%1B(D%1E(%87%0B!~%11%22R%20%23%93%0D%20%80%12(z%18)%94%12(f%20%26%8E%16%2Bq%1F%2B%8F%18'41%3D%87%1C(%A1%16)%A1%170%9A%1A%2C%8D%1F%22%15%3A~_%2C%3B%A2%195%9C%1D(%8D!3%9B%1D3%AD%1A6%98%22-%B0%1B.%7B%2C%2B%98%233%A0!0t.1%90%26.%97%238%87(7%8B(3%80-7j45N%3BF%AA%230%AA%237v2%3E%1FH%7D%98%2C%3A%1BI%91%A7)6%A6)%3B%99.5%A3-5)Ku1MQ%A3.%3B%BA(4%8D62%923B%963%3C%80%3B%3CMIU%8C8D%8A%3A8%B5.8%B5.%3E%86%3D9%AF1%3C%BE-%3FxCC%82%40J%B13C%AB5B%AD6%3D-Ww%B56%40%A8%3E2%AA%3CC%C07%40%A4%40%3A%B1%3BF%A1%40L%AD%3E%3F%C08F%A5%40G%AB%3EJ%9BD%3EwMU%80KW%A7BC%84LM%90IH%8FIQ%BB%3E%40%99HG%BB%3EF%BC%3EKrT%5D%A1HJ%B8BL%ABHA%C7%3FK%A4JF%A6KAGdiV%60e%A1NF%C
// si tu as une div #twitage et que tu mets ton nom twitter
// la ou il faut et que tu as chargée la lib jQuery qui va
// bien ca marche tout seul...
// [a améliorer]
var moulinette = {
sortie : '',
nettoyage: function(chaine) {
this.sortie = this.parse_liens(chaine);
this.sortie = this.parse_listes(this.sortie);
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
@lleixat
lleixat / gpt.2012.1.7.js
Created March 1, 2012 15:29
Google Plus Toolkit
/*
Google Plus Toolkit
Kevin Wang (kevixw'At'gmail.com)
Copyright (c) 2012 . All rights reserved.
Based on :
1. Google+ Stream API => An unofficial API to get Google+ streams.
https://gist.github.com/1554435
Copyright (C) 2012 Jingqin Lynn