Skip to content

Instantly share code, notes, and snippets.

🚀
To Boldly Go Where No Man Has Gone Before

Harshit Dwivedi the-dagger

🚀
To Boldly Go Where No Man Has Gone Before
Block or report user

Report or block the-dagger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@the-dagger
the-dagger / TmdbApi.java
Created Mar 16, 2016
The Moviedatabase API for retrofit
View TmdbApi.java
package io.github.the_dagger.movies;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
/**
* Created by Harshit on 2/13/2016.
*/
public interface TmdbAPI {
View AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
.
.
>
<receiver android:name=".Receivers.NetworkConnectivityChangeReceiver">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
@the-dagger
the-dagger / studio.txt
Last active Apr 30, 2016
A collection of shortcuts for Android Studio on Windows and Linux
View studio.txt
alt + f7 = find usage
ctrl + q = quick documentation
shift + f6 = refactor
ctrl + o = overide
ctrl + i = implement
View index.html
<form name="htmlform" id="form" enctype="multipart/form-data">
<p align="center"><b><big>FOSSASIA's App Generator</big></b></p>
<table align="center"
width = "900px"
height="200px">
<tr>
<td valign="top">
<label for="Email">Email</label>
</td>
<td valign="top">
View script.js
<script src="https://www.gstatic.com/firebasejs/live/3.0/firebase.js"></script>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script>
var $ = jQuery;
var timestamp = Number(new Date()); //this will server as a unique ID for each user
var form = document.querySelector("form");
var config = {
apiKey: "API_KEY",
authDomain: "app-id.firebaseapp.com",
View firebase.py
firebase = firebase.FirebaseApplication('https://app-id.firebaseio.com', None)
result = firebase.get('/users', str(arg))
jsonData = json.dumps(result)
email = json.dumps(result['Email'])
email = email.replace('"', '')
app_name = json.dumps(result['App_Name'])
app_name = app_name.replace('"', '')
print app_name
print email
View widget.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:id="@+id/widget_toolbar"
android:layout_height="?android:attr/actionBarSize"
android:background="@color/colorPrimary">
View list_widget_item.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="72dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp"
>
View WidgetDataProvider.java
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Binder;
import android.widget.RemoteViews;
import android.widget.RemoteViewsService;
/**
* Created by the-dagger on 24/7/16.
*/
View StockWidgetService.java
import android.content.Intent;
import android.widget.RemoteViewsService;
/**
* Created by the-dagger on 24/7/16.
*/
public class StockWidgetService extends RemoteViewsService {
@Override
public RemoteViewsFactory onGetViewFactory(Intent intent) {
You can’t perform that action at this time.