Skip to content

Instantly share code, notes, and snippets.

View lohic's full-sized avatar

Loïc Horellou lohic

View GitHub Profile
@lohic
lohic / in_array.java
Last active August 29, 2015 14:02
in_array for processing
import java.util.Arrays;
void setup() {
String[] tableau = {
"test", "youpi", "apple"
};
println(in_array("rien", tableau));
}
<?php
/**
* Supprimer les accents
*
* @param string $str chaîne de caractères avec caractères accentués
* @param string $encoding encodage du texte (exemple : utf-8, ISO-8859-1 ...)
*/
function suppr_accents($str, $encoding='utf-8')
{
// transformer les caractères accentués en entités HTML
@lohic
lohic / com.apple.ibooks.display-options.xml
Last active August 29, 2015 14:26
To force embed police when viewing pub on apple ibooks
<?xml version="1.0" encoding="UTF-8"?>
<display_options>
<!-- Supported values for platform name: "*", "iphone", "ipad"; "iphone" applies to ipod touch as well; note all-lowercase -->
<platform name="*">
<!-- allowed values for "fixed-layout" are either "true" or "false" (with "false" as the default when unspecified) -->
<option name="fixed-layout">false</option>
<!-- allowed values for "open-to-spread" are either "true" or "false" (with "false" as the default when unspecified) -->
<option name="open-to-spread">false</option>
<option name="specified-fonts">true</option>
</platform>
<?php
/**
* Script to clean up unused fields in page or file content files
* Compares fields present in the content file
* with fields defined in the blueprint
* and removes all undefined fields
*/
require __DIR__ . '/kirby/bootstrap.php';