Skip to content

Instantly share code, notes, and snippets.

@hlassiege
hlassiege / getculturecsharp.txt
Created May 3, 2018 09:28
getculturecsharp.txt
Culture culture = CultureInfo.CurrentCulture ;
@hlassiege
hlassiege / formatwithpear.php
Created May 3, 2018 09:28
formatwithpear.php
require_once 'I18Nv2.php';
$locale = &I18Nv2::createLocale('en_US');
echo "Format a currency value of 2000: ",
$locale->formatCurrency(2000, I18Nv2_CURRENCY_INTERNATIONAL), "\n";
echo "Format todays date: ",
$locale->formatDate(null, I18Nv2_DATETIME_FULL), "\n";
@hlassiege
hlassiege / formatdate.txt
Created May 3, 2018 09:27
formatdate.txt
string myDate = DateTime.Now.ToString(ci);
@hlassiege
hlassiege / formatcurrency.txt
Created May 3, 2018 09:27
formatcurrency.txt
CultureInfo ci = CultureInfo.CurrentCulture;
string money = 120.ToString(“c”,ci);
import locale
import datetime
locale.setlocale( locale.LC_ALL, 'en_US' )
// va afficher : '$188518982.18'
locale.currency( 188518982.18 )
// va afficher '1,255,000'
@hlassiege
hlassiege / format.php
Created May 3, 2018 09:27
format.php
$number = 1234.56;
// Notation anglaise (par défaut)
$english_format_number = number_format($number);
// 1,235 Notation française
$nombre_format_francais = number_format($number, 2, ',', ' ');
// 1 234,56
@hlassiege
hlassiege / csharputf8url.txt
Created May 3, 2018 09:26
csharputf8url.txt
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; CharSet=UTF8;
@hlassiege
hlassiege / csharputf8url.txt
Last active May 3, 2018 08:56
unicode python 2.x
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; CharSet=UTF8;
@hlassiege
hlassiege / sitemap.xml
Created June 6, 2017 07:53
sitemap alternates
<link rel="alternate" href="http://www.hopwork.fr" hreflang="fr-fr"/>
<link rel="alternate" href="http://fr.hopwork.ca" hreflang="fr-ca"/>
<link rel="alternate" href="http://fr.hopwork.com" hreflang="fr"/>
@hlassiege
hlassiege / analytics.yml
Last active August 29, 2015 14:10
Deployment file(s)
- hosts: analytics
sudo: true
vars_files:
- ../target/classes/version.yml
tasks:
- name: Ensure hopwork log folder exist
file: path=/var/log/hopwork/analytics/ state=directory group=www-data owner=www-data
- name: Ensure hopwork folder exist