Skip to content

Instantly share code, notes, and snippets.

View ofavre's full-sized avatar

Olivier Favre ofavre

  • WonderPush
  • Paris, France
View GitHub Profile
@ofavre
ofavre / hide-toggl-announcement-bar.user.js
Created May 15, 2019 10:38
[UserScript] Hide Toggl announcement bar
// ==UserScript==
// @name Hide Toggl announcement bar
// @namespace https://ofavre.dev/
// @version 1.0.0
// @description Hides the annoying Toggl announcement bar that wants you to upgrade to a paid plan.
// @author Olivier Favre (of.olivier.favre@gmail.com)
// @match https://toggl.com/app/*
// @grant none
// ==/UserScript==
@ofavre
ofavre / wonderpush-android-demo.dex-method-counts
Created November 17, 2017 11:28
Dex method count for WonderPush Demo Application
Processing wonderpush-android-demo/app/app-release.apk
Read in 14152 method IDs.
<root>: 14152
<default>: 1
a: 2288
a: 2288
a: 2288
a: 2288
a: 88
b: 240
@ofavre
ofavre / page.html
Created October 7, 2016 16:01
[WonderPush] Category-specific notification subscription switch sample code
<!-- With tags put inside the switch -->
<div>
Follow:
<div class="wonderpush-tag-switch" style="display: inline-block;" data-tag-field="string_categories" data-tag-value="music" data-on="Music" data-off="Music"></div>
<div class="wonderpush-tag-switch" style="display: inline-block;" data-tag-field="string_categories" data-tag-value="sport" data-on="Sport" data-off="Sport"></div>
</div>
<!-- Or with tags put outside the switch -->
<div>
<div class="wonderpush-tag-switch" style="display: inline-block;" data-tag-field="string_categories" data-tag-value="music" data-sentence="Music"></div>
<div class="wonderpush-tag-switch" style="display: inline-block;" data-tag-field="string_categories" data-tag-value="sport" data-sentence="Sport"></div>
@ofavre
ofavre / AppDelegate.m
Created February 18, 2016 16:24
WonderPush iOS SDK - Manual vs automatic AppDelegate forwarding
#import <WonderPush/WonderPush.h>
// [...]
// Here is how you would use automatic AppDelegate forwarding (recommended):
//
//- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// [WonderPush setClientId:@"YOUR_CLIENT_ID" secret:@"YOUR_CLIENT_SECRET"];
// [WonderPush setupDelegateForApplication:application];
@ofavre
ofavre / switch.css
Last active September 11, 2015 17:10
[WonderPush] Push notification subscription switch sample code
/*
* Push notification subscription switch
*/
.hide {
/* Use whichever definition suits you most */
display: none;
/*visibility: hidden*/
}
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building elasticsearch-action-updatebyquery 2.5.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ elasticsearch-action-updatebyquery ---
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ elasticsearch-action-updatebyquery ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
@ofavre
ofavre / mvn-test.output
Last active September 3, 2015 12:36
mvn test output for elasticsearch-analysis-combo using ES 1.4.0, Lucene 4.10.2 and randomizedtesting-runner 2.1.10
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building elasticsearch-analysis-combo 1.5.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.3:clean (default-clean) @ elasticsearch-analysis-combo ---
[INFO] Deleting file set: /data/Yakaz/elasticsearch-analysis-combo/target (included: [**], excluded: [])
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ elasticsearch-analysis-combo ---
@ofavre
ofavre / deletebyquery-has_parent-NPE.sh
Created April 22, 2013 13:38
NPE while using Delete By Query with Has Parent.
#!/bin/sh
curl -XPOST 'localhost:9200/index' -d '{index:{number_of_shards:1,number_of_replicas:0}}'
curl -XPUT 'localhost:9200/index/parent/_mapping' -d '{parent:{properties:{}}}'
curl -XPUT 'localhost:9200/index/child/_mapping' -d '{child:{"_parent":{type:"parent"}}}'
curl -XPUT 'localhost:9200/index/parent/parent1' -d '{name:"super shay"}'
@ofavre
ofavre / frankzappasmoustache-recreation.sh
Created March 15, 2013 11:12
Curl recreation for Combo Analyzer demo with frankzappasmoustache's configuration
#!/bin/bash
# Install ES 0.90.0.Beta1
[ -f elasticsearch-0.90.0.Beta1.tar.gz ] || wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.0.Beta1.tar.gz -O elasticsearch-0.90.0.Beta1.tar.gz
mkdir es-combo-demo
tar xf elasticsearch-0.90.0.Beta1.tar.gz -C es-combo-demo
cd es-combo-demo/elasticsearch-0.90.0.Beta1
# Configure it
cat >config/elasticsearch.yml <<EOF
cluster.name: elasticsearch-demo-combo
@ofavre
ofavre / DynamicSettings-study.md
Last active December 14, 2015 20:29
Study of Dynamic Settings in ElasticSearch 0.90.0.Beta1

Dynamic Settings in ElasticSearch 0.90.0.Beta1

Sources of dynamic settings

  • org.elasticsearch.index.settings.IndexDynamicSettingsModule
  • org.elasticsearch.cluster.settings.ClusterDynamicSettingsModule
  • org.elasticsearch.node.settings.NodeSettingsService.Listener

Cluster settings