Skip to content

Instantly share code, notes, and snippets.

@ricalo
ricalo / gist:86dd494c3d254c19806f
Created March 19, 2016 16:43
Fixing RTL8723BE intermittent connection
echo "options rtl8723be fwlps=N ips=N" | sudo tee /etc/modprobe.d/rtl8723be.conf
@ricalo
ricalo / reset.sh
Created March 2, 2016 17:48
Ubuntu no sound after restart
pulseaudio -k && sudo alsa force-reload
@ricalo
ricalo / emulator.md
Last active March 10, 2017 00:06
Start android emulator with virtualization on Linux

Linux with KVM and Google DNSs

 ~/Android/Sdk/tools/emulator -netdelay none -netspeed full -avd Nexus_5_API_24 -qemu -enable-kvm -dns-servers 8.8.8.8,8.8.4.4 &

AOSP build

emulator -skindir ~/Android/Sdk/skins -skin nexus_5x
@ricalo
ricalo / .bashrc
Last active April 30, 2024 15:15
Use git-bash from Android Studio terminal
if [ ! -z "${IDE}" -a "${IDE}" == "AndroidStudio" ]; then
cd $OLDPWD;
fi
@ricalo
ricalo / ADB.md
Last active February 8, 2016 19:54
ADB commands

Log relevant stuff for some Office 365 projects

adb -s [device] logcat -s Retrofit AuthenticationContext StorageHelp TokenCacheItem HttpWebRequest Oauth BasicWebViewClient BasicWebViewClientonPageStarted MyMeetingsService eglCodecCommon:S *:s
@ricalo
ricalo / gist:4aabeb31d43f5097036b
Created December 11, 2015 19:06
Solve $'\r': command not found error when running a script on Cygwin for Windows without altering the source file
bash -o igncr <script_file>
@ricalo
ricalo / Constants.java
Created April 6, 2015 19:38
Constants that my team uses in our Office 365 Android projects.
/*
* Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
*/
package com.microsoft.office365.profile;
interface Constants {
public static final String AUTHORITY_URL = "https://login.microsoftonline.com/common";
public static final String DISCOVERY_RESOURCE_URL = "https://api.office.com/discovery/v1.0/me/";
public static final String DISCOVERY_RESOURCE_ID = "https://api.office.com/discovery/";
public static final String MAIL_CAPABILITY = "Mail";
@ricalo
ricalo / Disconnect.java
Last active August 29, 2015 14:18
Function to remove the entries in the ADAL token cache, delete the cookies and set the relevant objects to null.This allows the app to disconnect from Office 365 and then connect with a different user.
private void disconnect(){
//Clear tokens.
AuthenticationManager
.getInstance()
.getAuthenticationContext()
.getCache()
.removeAll();
//Set manager objects to null.
MailManager.resetInstance();
@ricalo
ricalo / build.gradle
Created March 30, 2015 23:08
Gradle dependencies to use ADAL and the Office 365 SDK for Android
// base OData library:
compile group: 'com.microsoft.services', name: 'odata-engine-core', version: '0.12.1'
compile group: 'com.microsoft.services', name: 'odata-engine-android-impl', version: '0.12.1', ext:'aar'
// choose the discovery and outlook services
compile group: 'com.microsoft.services', name: 'discovery-services', version: '0.12.1'
compile group: 'com.microsoft.services', name: 'outlook-services', version: '0.12.1'
// Azure Active Directory Library
compile group: 'com.microsoft.aad', name: 'adal', version: '1.1.1'
@ricalo
ricalo / AndroidManifest.xml
Created March 30, 2015 22:35
Android permissions required to connect to Office 365 and use Outlook services.
<!-- Required to connect to Office 365 -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required to use outlook services -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />