Skip to content

Instantly share code, notes, and snippets.

View Fiedzia's full-sized avatar

Maciej Dziardziel Fiedzia

  • Farnborough, UK
View GitHub Profile
@Fiedzia
Fiedzia / icu_example.py
Last active October 4, 2023 23:21
python icu example
import icu
s = "a🙂b✋c🙋d🇸e🤦🏼<200d>♂f"
print(s.encode('utf8'))
us = icu.UnicodeString(s)
locale = icu.Locale.getUS()
bi = icu.BreakIterator.createCharacterInstance(locale)
bi.setText(us)
start = 0
@Fiedzia
Fiedzia / -
Last active March 31, 2017 16:33
-
@Fiedzia
Fiedzia / gist:64f5e658725d2ddafa23
Created May 3, 2014 12:14
How to use logging in a library?
#[crate_id = "n#0.1"]
#[crate_type = "lib"]
#![feature(phase)]
#[phase(syntax, link)] extern crate log;
pub fn foo() {
error!("This is an error log")
warn!("This is a warn log")
info!("this is an info log")
@Fiedzia
Fiedzia / query.json
Last active December 18, 2015 04:49
ES query we perform
{
"sort": [
{
"pins.date_added": {
"order": "desc",
"nested_filter": {
"terms": {
"pins.owner_id": [
569,
236663,