Skip to content

Instantly share code, notes, and snippets.

@CedricGatay
CedricGatay / install_vagrant_sudoers.sh
Last active August 29, 2015 13:55 — forked from GUI/install_vagrant_sudoers.sh
Script for placing sudoers.d files with syntax-checking, from https://gist.github.com/GUI/2864683, adapted to work with Vagrant 1.4.x under OS X / Linux
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# From https://gist.github.com/GUI/2864683, adapted to work
# with Vagrant 1.4.x under OS X / Linux
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers.XXX)
cat /etc/sudoers > $TMP
# Does not reedit file
[INFO] --- merge-properties-maven-plugin:1.0:merge (merge) @ i18n ---
[INFO] Found propertyFileName without prefix checking, including... [src/main/resources/l10n/Global_en.properties]
[INFO] Found propertyFileName without prefix checking, including... [src/main/resources/l10n/Global_fr.properties]
[INFO] => Final file language.properties [en] contains 10624 entries
[INFO] => Final file language.properties [fr] contains 10647 entries
[INFO] Found propertyFileName without prefix checking, including... [src/main/resources/help/Global_en.properties]
[INFO] Found propertyFileName without prefix checking, including... [src/main/resources/help/Global_fr.properties]
[INFO] => Final file help.properties [en] contains 371 entries
[INFO] => Final file help.properties [fr] contains 376 entries
@CedricGatay
CedricGatay / AbstractCDIWicket_IT.java
Last active December 18, 2015 00:09
Base test class for Wicket with CDI using Arquillian
/*
* Copyright 2013 Code-troopers.com
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@CedricGatay
CedricGatay / gist:3416073
Created August 21, 2012 14:38
Jenkins : quick create job and vm for feature branch
import hudson.model.FreeStyleProject
import hudson.model.Result
import hudson.plugins.copyartifact.CopyArtifact
import hudson.plugins.git.BranchSpec
import hudson.tasks.BuildTrigger
def featureName = "feature"
def branchName = "origin/feature/mybranch"
def jenkins = jenkins.model.Jenkins.instance
@CedricGatay
CedricGatay / .gitconfig
Created October 30, 2010 09:41
git config with autosql alter
[color]
ui = auto
[alias]
amend = commit --amend
st = status
who = shortlog -sne
oneline = log --pretty=oneline --abbrev-commit --graph
changes = diff --name-status
dic = diff --cached
diffstat = diff --stat
@CedricGatay
CedricGatay / tiny_mce_src.js
Created October 24, 2010 07:51
TinyMCE 3.3.9.2 patched to work with Apache Wicket's ajax requests
(function(win) {
var whiteSpaceRe = /^\s*|\s*$/g,
undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1';
var tinymce = {
majorVersion : '3',
minorVersion : '3.9.2',
releaseDate : '2010-09-29',
package fr.gatay.cedric.android.bintools;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index c335b02..887be30 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -31,6 +31,7 @@ import android.media.AudioManager;
import android.net.Uri;
import android.os.IBinder;
import android.os.SystemClock;
+import android.os.SystemProperties;
import android.preference.PreferenceManager;
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index c335b02..2bad6dc 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -26,22 +26,22 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
import android.database.Cursor;