Skip to content

Instantly share code, notes, and snippets.

View opatry's full-sized avatar
👋
Hi!

Olivier Patry opatry

👋
Hi!
View GitHub Profile
@opatry
opatry / desktop-entry_getting-started.js
Last active December 19, 2015 17:19
X11 Desktop Entry Getting Started.
var desktop_entry = require('desktop-entry');
desktopEntry.load({
entry:'./myfile.desktop',
onSuccess:function(model){
// model is a JSON representation of the Desktop Entry file
// where sections are roots of JSON object
// each root contains a list of {key:value} objects.
console.log(model["Desktop Entry"].Version);
},
onError:function(errorMessage){
@opatry
opatry / bash_colors.sh
Last active December 20, 2015 09:38
Bash template for script using colors.
#!/bin/bash
# Reset
Color_Off='\e[0m' # Text Reset
# Regular Colors
Black='\e[0;30m' # Black
Red='\e[0;31m' # Red
Green='\e[0;32m' # Green
Yellow='\e[0;33m' # Yellow
@opatry
opatry / Rules
Created January 24, 2015 17:15
nanoc Rules with snapshots
compile '*' do
if item[:extension] == 'css'
# don’t filter stylesheets
elsif item.binary?
# don’t filter binary items
else
filter :erb
snapshot :first
layout 'default'
snapshot :second
@opatry
opatry / src-main-res-layout-mylistitem.xml
Last active October 30, 2017 08:10
Using Android sample data `tools:showIn`, `tools:listitem`, `tools:...="@sample/data.json` for awesome layout preview
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:showIn="@layout/myscreen">
<ImageView
@opatry
opatry / build.gradle
Last active May 6, 2022 11:10
CI Test execution on Android
subprojects {
afterEvaluate { proj ->
if (proj.hasProperty('android')) {
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
if (proj.hasProperty('kotlin')) {
@opatry
opatry / GridLayer.kt
Created March 18, 2021 22:11
A Jetpack Compose grid overlay to ease alignment of design mockup
// Copyright (c) 2021 Olivier Patry
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the Software
// is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
{
"meta": {
"theme": "macchiato"
},
"basics": {
"name": "Olivier Patry",
"label": "Engineering Manager & Senior software engineer",
"picture": "https://www.gravatar.com/avatar/3eae340e049abecfb4a117ad7a907bd1?s=256&d=mp",
"email": "[email protected]",
"phone": "(+33)6 64 73 35 96",