In JavaScript I want to change some formatted numbers to a regular number. The code might be look like that: var aNb=[ 1500, “1,500”, “15,00”, “1,500,000”, “1,500,000.25”, “1000.25”, “1 000 000”]; for (var i=0; i < aNb.length; i++) { var nb = aNb[i] + “”; if (nb.split(“,”).length <= 2) nb = nb.replace(/,(\d{2})$/,”.$1″); nb = nb.replace(/[^\d\.\-]/g, […]
Author: Aymeric
Force CORS headers in Firefox to allow cross domain calls
This guy created a Firefox extension to force the CORS (access-control) headers from a call. This is very useful when you want to do a JavaScript/AJAX query over another website that doesn’t allow the cross domain calls. His code is on github. I’ve the XPI compiled version on my blog (into a ZIP file) found […]
Sharepoint Workflow: Check if a field is empty [Sharepoint 2010]
The Sharepoint workflows are powerful but sometimes stupid… If you want to: Check if a Date Field is empty, then you can use a String Workflow Variable that contains your Date Field as a Short Date (SP2013) (or a String for SP2010), and then compare it to “1/1/0001” (or “1/1/0001 12:00:00 AM” for SP2010) Check […]
“class-phpmailer out of memory using GuiForm” avec WordPress
Ayant un WordPress sur 1and1 j’ai été confronté à un “out of memory” sur le fichier class-phpmailer.php à cause d’un appel AJAX d’un formulaire créé avec GuiForm. Je ne peux pas faire grand chose côté serveur à cause de l’hébergement partagé… Donc j’ai fouillé comment contourner le problème. Il va s’agir de modifier le fichier […]
Afficher correctement les caractères dans les fichiers de logs [Unix]
Lorsqu’on regarde ses fichiers de logs Apache (par exemple), on peut se retrouver face à des caractères dont l’encodage est bizarre… par exemple “là” donnera “l\xe0”. Pour afficher correctement les caractères dans votre console (en l’occurrence j’utilise Putty en encodage Latin1), il faut utiliser la commande suivante, trouvée sur StackOverflow : tailf /var/log/apache2/error.log | while […]
Windows 10 et Cortana : lancer les recherches sur Google au lieu de Bing sous Firefox
Microsoft essaie d’imposer son moteur de recherche, mais je continue à préférer Google…. Du coup quand Cortana sous Windows 10 nous redirige sur Bing, ça m’agace… Sous Firefox on peut utiliser l’extension Redirector puis appliquer les règles suivantes : Example URL : https://www.bing.com/search?q=*&* Include Pattern : https://www.bing.com/search?q=*&* Redirect To : https://www.google.de/#safe=off&q=$1 Pattern Type : Wildcard […]
Android 5.1.1 system rw Operation not permitted
I was trying to update my Sony Xperia Z3 Compact from Android 5.0.2 (rooted) to Android 5.1.1, and everything worked well except that I got this issue : mount: Operation not permitted when I was trying to put in write mode the system folder. Also I tried SDFix and I got the error “Update failed, […]
Cacher le SSID Public d’une Fonera 2100 avec le firmware FrancoFON
Voilà un titre de billet très spécifique… Mais si vous avez une vieille Fonera comme moi, vous avez peut-être installé FrancoFON et donc vous avez un accès SSH. Une fois connecté en SSH, pour cacher le SSID Public de la Fonera, il suffit d’entrer la commande : iwpriv ath0 hide_ssid 1
Android Lollipop – problème de microphone qui ne fonctionne plus
J’ai un Sony Xperia Z3 Compact et, soudainement, le micro s’est arrêté de fonctionner. Je suis passé sous Lollipop il y a quelques jours. Après investigation, cela est peut-être dû à l’utilisation de mon casque pour écouter de la musique… J’ai donc effectué quelques recherches pour trouver un correctif, et c’est finalement venu du Issue […]
Root/directory, 0x8004100E – (WBEM_E_INVALID_NAMESPACE) Namespace specified cannot be found
I think I found the MOF file related to the above error. To fix it you might try: C:\Windows\System32\wbem>mofcomp DscCore.mof