Skip to content

Instantly share code, notes, and snippets.

View be1's full-sized avatar

Benoît Rouits be1

View GitHub Profile
@be1
be1 / getsdcards.java
Last active December 7, 2015 12:43
getting sdcards path list on android
private static String[] getSdcards() {
// Final set of paths
final Set<String> rv = new HashSet<String>();
// Primary physical SD-CARD (not emulated)
final String rawExternalStorage = System.getenv("EXTERNAL_STORAGE");
verboseDebug("EXTERNAL_STORAGE env is: " + rawExternalStorage);
// All Secondary SD-CARDs (all exclude primary) separated by ":"
final String rawSecondaryStoragesStr = System.getenv("SECONDARY_STORAGE");
verboseDebug("SECONDARY_STORAGE env is: " + rawSecondaryStoragesStr);
// Primary emulated SD-CARD
@be1
be1 / brasero2tex.rs
Last active April 4, 2021 14:41
Quick (Rust version) LaTeX cd-cover generator from a brasero xml project.
use serde_derive::Deserialize;
use structopt::StructOpt;
use serde_xml_rs::from_str;
use percent_encoding::percent_decode_str;
use chrono::Local;
#[derive(StructOpt)]
struct Cli {
/// The path to the file to read
#[structopt(parse(from_os_str))]
@be1
be1 / brasero2tex.go
Last active May 16, 2021 03:10
Quick (go version) program to generate a LaTeX cdcover from an xml Brasero project.
package main
import (
"os"
"time"
"strings"
"fmt"
"io/ioutil"
"encoding/xml"
"net/url"
@be1
be1 / zimbra-soap.txt
Created September 2, 2010 12:02 — forked from MattMencel/zimbra-soap.txt
Zimbra 6.0.4 soap.txt file with json examples
REST URL for requesting content:
http://server/service/home/[&tilde;][{username}]/[{folder}]?[{query-params}]
fmt={ics, csv, etc}
id={item-id}
imap_id={item-imap-id}
part={mime-part}
query={search-query}
types={types} // when searching
auth={auth-types}
@be1
be1 / brasero2Tex.py
Last active November 10, 2023 17:37
Quick script to generate a LaTeX 'cd-cover' sheet from a Brasero project file, for music compilations.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, re, datetime, urllib.parse, xml.etree.ElementTree as ET
if len(sys.argv) < 2:
sys.exit('Usage: %s brasero.project.file' % sys.argv[0])
tree = ET.ElementTree(file=sys.argv[1])
root = tree.getroot()