Skip to content

Instantly share code, notes, and snippets.

View manijshrestha's full-sized avatar

Manij Shrestha manijshrestha

View GitHub Profile
@manijshrestha
manijshrestha / index.htlm
Created October 19, 2012 20:15
Building app with responsive design using jQuery mobile and CSS3 (Media Query)
<!DOCTYPE html>
<html>
<head>
<title>Cool App</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
@manijshrestha
manijshrestha / gist:6565314
Created September 14, 2013 20:20
Chromecast Sender
<html data-cast-api-enabled="true">
<head>
<title>Chromecast Sender</title>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
//Jquery Init
$(function(){
$("#receivers").html('Initializing...');
$("#playBtn").bind("click", doPlay);
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
classpath 'me.champeau.gradle:gradle-groovy-android-plugin:0.3.0'
}
}
@manijshrestha
manijshrestha / gist:42cf2f97c3779cb033c0
Created September 3, 2014 04:49
Groovy-Android-Dependency
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.codehaus.groovy:groovy:2.4.0-beta-3'
}
@manijshrestha
manijshrestha / gist:a084447d11fd3b84b700
Created September 3, 2014 05:09
Groovy-Android-DroidActivity
package com.manijshrestha.groovydroidexample
import android.app.Activity
import android.os.Bundle
import android.widget.TextView
import groovy.transform.CompileStatic
@CompileStatic
public class DroidActivity extends Activity {
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
...
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.manijshrestha.lollipopkiosk">
...
<uses-permission android:name="android.permission.INTERNET" />
...
</manifest>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".KioskActivity">
<WebView
android:id="@+id/web_content"
android:layout_width="match_parent"
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_kiosk);
mWebView = (WebView) findViewById(R.id.web_content);
mWebView.getSettings().setJavaScriptEnabled(true);
@Override
protected void onPostCreate(Bundle bundle) {
super.onPostCreate(bundle);
getActionBar().hide();
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(