Skip to content

Instantly share code, notes, and snippets.

View pascalchevrel's full-sized avatar

Pascal Chevrel pascalchevrel

View GitHub Profile
Exciting! Firefox is now providing simple and chic interfaces for representing, setting and picking a time or date on Nightly. Various content attributes defined in the HTML standard, such as @step, @min, and @max, are implemented for finer-grained control over data values.
Take a closer look at this feature, and come join us in making it better with better browser compatibility!
What’s Currently Supported
<input type=time>
The default format is shown as below.
Here is how it looks when you are setting a value for a time. The value provided must be in the format “hh:mm[:ss[.mmm]]”, according to the spec.

Windows

Operating Systems (32-bit and 64-bit)

  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Vista (32-bit Firefox only)
  • Windows Server 2003 SP1 (32-bit Firefox only)
  • Windows XP SP2 (32-bit Firefox only)
@pascalchevrel
pascalchevrel / sysreq50_1_0.md
Created December 20, 2016 11:22
system requirements text update

Windows

Operating Systems (32-bit and 64-bit)

  • Windows XP SP2
  • Windows Server 2003 SP1
  • Windows Vista
  • Windows 7
  • Windows 8
  • Windows 10
@pascalchevrel
pascalchevrel / check_locales_product_details.php
Last active August 5, 2016 11:14
PHP script checking if the data in product-details for aurora and nighmty matches what we actually build from mercurial
<?php
function getJson($file) {
return json_decode(
file_get_contents('https://product-details.mozilla.org/1.0/' . $file),
true
);
}
function getProductDetailsLocales($version) {
#! /usr/bin/env bash
# Pretty printing utility function
function echogreen() {
NORMAL=$(tput sgr0)
GREEN=$(tput setaf 2; tput bold)
echo -e "$GREEN$*$NORMAL"
}
# Path to the temporary profile
<?php
/**
* Return the current URL with the json GET variable appended
* This is used on views which also exist in our public API
* https://github.com/mozfr/transvision/wiki/JSON-API
*
* @param boolean $swap_locales Defaults to False. If set to True, swap the
* values of locale and source_locale parameters.
* @return string URL with 'json' appended as part of the query string
*/
@pascalchevrel
pascalchevrel / patchy.txt
Created January 20, 2016 10:52
A bash function to put in your .bash_aliases to send the diff of your repo (hg, git svn…) to a remote 'patches' folder that you make web accessible for sharing
function patchy()
{
tmp='/tmp/diff_being_sent_to_your_server'
$1 diff > $tmp
scp $tmp john@doe.com:/home/john/patches/$2.diff
rm $tmp
}
@pascalchevrel
pascalchevrel / gist:7299680
Created November 4, 2013 08:26
This is a PHP function to check if a file has a UTF8 encoding, UTF8 files that only contain ASCII characters are detected as us-ascii by PHP.
<?php
function isUTF8($filename)
{
$info = finfo_open(FILEINFO_MIME_ENCODING);
$type = finfo_buffer($info, file_get_contents($filename));
finfo_close($info);
return ($type == 'utf-8' || $type == 'us-ascii') ? true : false;
}
@pascalchevrel
pascalchevrel / gist:6099342
Last active December 20, 2015 08:19
Use bugzilla advanced search results returned as CSV as a simple and efficient read-only API to query Bugzilla. The official bugzilla API doesn't allow searching all of the fields, the advanced query page does. In most of the cases, what you want are bug numbers and bug titles from a search query. Since we can now get bug numbers from an arbitra…
<?php
function getBugsFromCSV($csv, $full = false)
{
$shortBugs = $fullBugs = $temp = [];
if (($handle = fopen($csv, 'r')) !== false) {
while (($data = fgetcsv($handle, 300, ',')) !== false) {
if ($data[0] == 'bug_id') {
@pascalchevrel
pascalchevrel / gist:6069330
Last active December 20, 2015 04:18
Script to convert a Serbian Cyrillic repo to Latin script
#!/usr/bin/env php
<?php
// Transliteration to Serbian requires ICU library >= 5.0
if (php_sapi_name() != 'cli') {
die('Nope');
}
$targetFolder = (isset($argv[1])) ? $argv[1] : 'sr-Latn'; // target folder