Laravel and SELinux

When SELinux is enabled, apache can be denied to write to the storage directory even if the permission of this directory is set to 777. chcon -Rt httpd_sys_content_rw_t storage/ You can see the result: ls -Z

Firebase Cloud Messaging without google-services.json file

The default way to initialize Firebase in your Android app is to use the google-services.json file you can download from the firebase console. The content of this file will be automatically merged by gradle to initialize the FirebaseApp instance for your app. To manually initialize a FirebaseApp app, you can do the following (I replaced the real […]

SSH Agent forwarding on Bash on Ubuntu on Windows

To enable key forwarding on Bash on Ubuntu on Windows. Create a ~/.ssh/config file with at least: Host *   ForwardAgent yes Start ssh-agent: eval `ssh-agent -s` Then add key(s): ssh-add Then you can ssh into some machine.

Remove animation Android activity

By setting some style properties, you can remove the animation. <style name="ThemeWindowNoAnimation" parent="Theme.AppCompat.NoTitleBar.Fullscreen"> <item name="android:windowAnimationStyle">@null</item> <item name="android:windowEnterAnimation">@null</item> <item name="android:windowExitAnimation">@null</item> </style>

Change Android homeAsUpIndicator icon in Titanium

For a project I wanted to show a hamburger menu icon in the main screen that shows a navigation drawer. The steps I did: I manually enabled the displayHomeAsUp property of the ActionBar and handled the onHomeIconItemSelected event to show the navigation drawer: $.mainWindow.activity.actionBar.displayHomeAsUp = true; $.mainWindow.activity.actionBar.onHomeIconItemSelected = function() { onMenu(); }; And also replaced the "back" […]

Remove shadow Android ActionBar

If you want to remove the shadow below the ActionBar (for example in the AppCompat.Light theme), first create a style: <style name="ThemeActionBarWithoutShadow" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse"> <item name="elevation">0dp</item> <!--<item name="android:elevation">0dp</item>--> </style> And then reference it from within a theme: <style name="ThemeDefault" parent="Theme.AppCompat.Light"> <item name="colorPrimary">#F2E49F</item> <item name="colorPrimaryDark">#F2E49F</item> <item name="actionBarStyle">@style/ThemeActionBarWithoutShadow</item> </style>

Android emulator screenshot

A simple way to take screenshots of your Android emulator: adb shell /system/bin/screencap -p /sdcard/screenshot.png adb pull /sdcard/screenshot.png screenshot.png

Laravel and SVN

Laravel assumes you're using GIT to handle version control. Here is a guideline to fix it for SVN. In short: just add all the files and directories named  in the .gitignore files to the SVN ignore list. Add the contents of the following directories to the ignore list (so the directories will be in version […]

Remove web middleware for API in Laravel

The web middleware is by default loaded for ebery route in the app/Http/routes.php file. If you create an API, you mostly don't need all the things this web middleware is loading, like cookie sessions and CRSF protection. To create routes for the API: Create a new app/Http/routes-api.php file and add the routes for the API. […]

CLI import new project Titanium Appcelerator

If get the error "Application not registered" after trying to build a Titanium Project, you can use the following command to register the app from the CLI: appc new --import