Skip to content

Instantly share code, notes, and snippets.

View the-dagger's full-sized 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
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;
<?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>
<?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",
<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">
<?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 August 17, 2016 10:31
Upload sample app to github repo from travis
#!/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

GSoC 2016 Work Product, Harshit Dwivedi - FOSSASIA

This summer, I worked on FOSSASIA's Open Event Android App Generator for generating a customized android app for any event and enhanced the already existing Android app by adding a schedule in it and various UI/UX enhancements.
The app-generator server is hosted on a VPS server and runs on ubuntu

It takes in the data entered by the user on the generator website and then using that data and our app's source code generates an app customized to their need and emails it to them.
User can either upload an API endpoint or a zip containing json files on the generator where the data to be displayed in the app will be fetched from

A test setup of our project can be accessed here

@the-dagger
the-dagger / .gitconfig
Created September 30, 2016 08:49 — forked from donnfelker/.gitconfig
My .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 October 20, 2016 09:31 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@the-dagger
the-dagger / cfp.md
Last active December 8, 2016 20:10

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.