Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
To Boldly Go Where No Man Has Gone Before

Harshit Dwivedi the-dagger

🚀
To Boldly Go Where No Man Has Gone Before
View GitHub Profile
View AppWidgetProvider.java
import android.annotation.TargetApi;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.annotation.NonNull;
import android.widget.RemoteViews;
View widget_info.xml
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialKeyguardLayout="@layout/app_widget"
android:initialLayout="@layout/app_widget"
android:minHeight="110dp"
android:minWidth="170dp"
android:previewImage="@drawable/example_appwidget_preview"
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="86400000"
android:widgetCategory="home_screen"></appwidget-provider>
View api.php
<?php
function sendResponse($data) {
header('Content-type: application/json');
echo json_encode($data);
die();
}
/* If the request isn't a POST request then send an error message*/
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
sendResponse([
"status"=>"error",
View index.html
<html>
<head>
<title>Apk Generator</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href='https://fonts.googleapis.com/css?family=Roboto:400,100' rel='stylesheet' type='text/css'>
<link href="css/main.css" rel="stylesheet">
View test.php
<?php
if(isset($_POST['timestamp']))
{
$uid = escapeshellcmd($_POST['timestamp']);
exec("sudo sh /var/www/email.sh $uid");
}
?>
@the-dagger
the-dagger / uploadApk.sh
Last active Aug 17, 2016
Upload sample app to github repo from travis
View uploadApk.sh
#!/usr/bin/env bash
mkdir $HOME/daily/
cp -R /home/travis/build/fossasia/open-event-android/android/app/build/outputs/apk/app-fdroid-debug.apk $HOME/daily/
# go to home and setup git
cd $HOME
git config --global user.email "harshithdwivedi@gmail.com"
git config --global user.name "the-dagger"
git clone --quiet --branch=development https://the-dagger:$GITHUB_API_KEY@github.com/fossasia/open-event-android development > /dev/null
@the-dagger
the-dagger / .gitconfig
Created Sep 30, 2016 — forked from donnfelker/.gitconfig
My .gitconfig
View .gitconfig
[user]
name = Your Name
email = you@youremail.com
[alias]
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD
@the-dagger
the-dagger / introrx.md
Created Oct 20, 2016 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
View cfp.md

Outline :

Open Source is increasingly making the news. With the many business and government bodies that now use open source offerings, it's becoming quite obvious that being free is not the only advantage Open Source Software provides. In this talk, I'll be taking you through the magical realm of the Land known as Open Source. What it is, what it is not and how can you be a part of it.

Talk Structure :

  • Introduction to Open Source (5 mins):
    I'll be talking briefly about what Open Source means and will be debunking common myths regarding Open Source.
View MainActivity.java
package com.example.news.androidp1;
import android.content.Intent;
import android.os.AsyncTask;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.AsyncTaskLoader;
import android.support.v4.content.Loader;
import android.support.v4.text.TextUtilsCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
You can’t perform that action at this time.