Skip to content

Instantly share code, notes, and snippets.

View Remiii's full-sized avatar
👨‍💻
remibarbe.fr

Rémi Barbe Remiii

👨‍💻
remibarbe.fr
View GitHub Profile
@Remiii
Remiii / README.md
Created November 24, 2012 15:07 — forked from agnoster/README.md
My ZSH Theme

remiii.zsh-theme

This theme is based on agnoster.zsh-theme.

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
@Remiii
Remiii / gist:4297943
Created December 15, 2012 18:35
Vagrantfiles (config sample).
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "NameOfYourBaseBox"
@Remiii
Remiii / gist:4335555
Created December 19, 2012 09:32
Twig extension - Filter for month number
/**
* getFilter
*/
public function getFilters ( )
{
return array (
'month_name' => new \Twig_Filter_Method ( $this , 'get_month_name' )
) ;
}
@Remiii
Remiii / Humans.txt
Last active December 16, 2015 05:19
My Humans.txt sample file
/* TEAM */
Name: Rémi Barbe
Contact: free-software <<at>> remibarbe <<dot>> fr
Twitter: @Remiii_
From: Bordeaux/Paris, France
/* THANKS */
@Remiii
Remiii / xml-split.awk
Last active September 24, 2018 10:50
AWK - split XML subnodes into separate files
# This awk script splits an XML file and exports X nodes into separate file
# It doesn't work if the main node has an attribute
# It doesn't work if the main node contains a subnode with the same tagname, etc.
# Use at your own risk, think before using.
# Usage:
# - Replace "myNumberOfNodesByOutputFile" by your number of nodes by output file
# - Replace "myChildNode" by your tag
# - Replace "myParentNode" by your parent tag
# Run:
# $ awk -f xml-split.awk myXML.xml
@Remiii
Remiii / README.md
Last active December 16, 2015 15:49
Get line number when number of occurrences of a specific pattern in a line is different from a given argument. Usefull for test the number of columns in a CSV file.

Get line number when number of occurrences of a specific pattern in a line is different from a given argument. Usefull for test the number of columns in a CSV file.

  • myFile => file
  • myPatern => specific pattern
  • myNumberOfOccurrences => number of occurrences in a line

How to custom Hostname

$ sudo ./customHostname.sh myHostname myDomain myIP

Sample

$ sudo ./customHostname.sh vito remibarbe.fr 45.132.12.35
@Remiii
Remiii / .htaccess
Created April 27, 2013 16:39
Redirect non-www to www with Apache .htaccess
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
@Remiii
Remiii / .htaccess
Created May 5, 2013 14:49
Redirect www to non-www with Apache .htaccess
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
@Remiii
Remiii / key1.pgp
Last active April 27, 2017 10:13
My PGP Public Key1
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFj80rcBEADkNAuCPZevurJp5Z8qqv4lDX0XYUVhVFfI88tS0mTPYv0W7Oxx
jIKgYql/0NLh7iWGKaLeeYynRRadove9W5shBfzQVgBCAWsHaMsliv9DxM8jZoq3
eziHHvfLXPKhRKSSf0WQFyg2Lg5eAJw4zQTCR/QPSKZRKkgOY9JcGgedt+lIpkeV
rFydBIiLDUKdabhv6RlqIG5t1NIcU150iFA7SJfis2ee5bVTe46gS5Fr/YFvnK5P
j9kFx6CAfP6JYC2kLlbC8yYItzwflKefUnRNMUJfn4XRhIfCIaY4i34x7btgtr+4
wfNonba+zC9g07Ej6CiuA1GPg13/I6lBt5DkJNcPVqmk1Qjw3WbTBWMLpFMS821R
VG3nIwDCQu3Hz2q5bO+SIlPFBI6w5PhPiRvlV/D6QLFc9b2mJYnzPFuqBGfw9kUu
7OcQnEBUeZQ5cgWNw6pA8eBSn6T62sgQUjK4md9w7C2qNJK4a9kLOg4qB6FnxB9g