Skip to content

Instantly share code, notes, and snippets.

View deepakpk009's full-sized avatar
๐Ÿ‘‹
Android & Roku Development

Deepak PK deepakpk009

๐Ÿ‘‹
Android & Roku Development
View GitHub Profile
@deepakpk009
deepakpk009 / MainActivity.java
Created August 20, 2017 09:45 — forked from takeshiyako2/MainActivity.java
Android Sample Open Facebook Page
package facebook.page.test;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
@deepakpk009
deepakpk009 / batch_resize.txt
Created August 13, 2017 09:33
batch resize images in a folder
Use Imagemagick's batch tool, mogrify.
This takes most of the same arguments.
To scale the longest size down to 300px, we can offer -resize "300x300>".
For safety's sake I've also got this saving the new images into a subdirectory rather than overwriting.
# assuming you're in the directory of images
mkdir resized
mogrify -resize "300x300>" -path resized *.jpg
The ">" means that It will only resize if the image is bigger than the given size.
@deepakpk009
deepakpk009 / wifi_ubuntu_help.txt
Created August 11, 2017 08:56
wifi not connecting problem in ubuntu
sometimes in ubuntu the wifi will not connect to the network,
it will continiously try to connect to a wifi network but will fail
continously. for this apply the following fix:
1. open terminal - > type in 'ifconfig' -> enter
it will list the available networks like this:
enp2s0 Link encap:Ethernet
lo Link encap:Local Loopback
wlp3s0 Link encap:Ethernet
@deepakpk009
deepakpk009 / RestClient.java
Created August 8, 2017 09:43
How to POST Form data with multiple attachments using Retrofit
public interface FormUploadService {
@Multipart
@POST("<post-url-endpoint>") // the post url endpoint
Observable < String > postFormWithAttachments(
@Header(AppConstants.KEY_AUTH) String authKey, // auth key, if required
@PartMap Map < String, RequestBody > params); // our form data map
}
public void postForm(String authKey,
@deepakpk009
deepakpk009 / remove_tag_git.txt
Last active August 8, 2017 09:30
Removing a tag from git
If you have created a tag called 'release01'
in a Git repository you would remove it from your repository
by doing the following:
$ git tag -d release01
$ git push origin :refs/tags/release01
to push every local tag to remote
git push origin --tags
@deepakpk009
deepakpk009 / add_git_submodule.txt
Created August 8, 2017 09:26
how to add a git android library project as a sub module, to a project
how to add a git android library project as a sub module, to a project
1. create an android project
2. add to vcs (vcs - import into version control - create git repository)
3. goto terminal and add sub-module - make sure the location folder name is different than the original project name
git submodule add https://[email protected]/YYY/ZZZ.git
4. goto file menu - project structure
5. click '+' on left top
6. select 'import gradle project'