Skip to content

Instantly share code, notes, and snippets.

View aznoisib's full-sized avatar

aznoisib aznoisib

View GitHub Profile
@aznoisib
aznoisib / ac.xml
Created April 15, 2020 15:52
Layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:aapt="http://schemas.android.com/aapt" android:id="@+id/coordinator_layout" android:layout_width="match_parent" android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout android:theme="@style/AppTheme.AppBarOverlay" android:layout_width="match_parent" android:layout_height="wrap_content"/>
<include layout="@layout/content_main"/>
</android.support.design.widget.CoordinatorLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="-1" android:layout_height="-1" app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior">
<RelativeLayout android:id="false" android:focusableInTouchMode="true" android:layout_width="-1" android:layout_height="-1">
<android.support.v7.widget.Toolbar android:theme="resourceId:0x7f0f000a" android:id="false" android:background="{2:2130903182}" android:layout_width="-1" android:layout_height="{2:2130903043}" android:layout_alignParentTop="true" android:elevation="4dp">
<LinearLayout android:layout_width="-1" android:layout_height="-1">
<TextView android:textColor="resourceId:0x106000b" android:gravity="0x11" android:id="false" android:background="res/drawable/ic_tab_black_24dp.xml" android:padding="5dp" android:layout_width="{2:2130903043}" android:la
@aznoisib
aznoisib / Main.java
Last active June 18, 2020 23:50
Drivepad Browser android
package id.cybercode.drivepadbrowser3;
import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@aznoisib
aznoisib / jq.simple_timer.js
Created November 2, 2019 20:16 — forked from michealbenedict/jq.simple_timer.js
Simple jQuery Timer Plugin
/*
* @Module Timer
* @author : Micheal
*
* @usage:
$(document).ready(function() {
$(".s1").timer({
from: 100, //sec
end: function() {
console.log('triggerd at the end of timer')
@aznoisib
aznoisib / jQueryPluginPatterns.js
Created September 24, 2019 13:41 — forked from addyosmani/jQueryPluginPatterns.js
jQuery Plugin Patterns
/*
A (very) WIP collection of optimized/recommended jQuery plugin patterns
from @addyosmani, @cowboy, @ajpiano and others.
Disclaimer:
-----------------------
Whilst the end-goal of this gist is to provide a list of recommended patterns, this
is still very much a work-in-progress. I am not advocating the use of anything here
until we've had sufficient time to tweak and weed out what the most useful patterns
@aznoisib
aznoisib / file_upload.html
Created September 20, 2019 16:09 — forked from wwgist/file_upload.html
HTML5: files upload
<!-- via control upload -->
<input type="file" id="your-files" multiple>
<script>
var control = document.getElementById("your-files");
control.addEventListener("change", function(event) {
// When the control has changed, there are new files
var i = 0,
files = control.files,
@aznoisib
aznoisib / submit.md
Created August 31, 2019 21:23 — forked from tanaikech/submit.md
Upload Files to Google Drive using Javascript

Upload Files to Google Drive using Javascript

This is a sample script for uploading files to Google Drive using Javascript. The files are uploaded by Drive API v3. gapi.client.drive.files.create() can create an empty file on Google Drive. But it cannot directly upload files including contents. I think that this might not be able to upload files and metadata with the multipart/related, although this might be resolved by the future update. So now, as one of workarounds, I use using XMLHttpRequest.

  • This sample uses gapi.
    • Before you use this, please enable Drive API at API console and carry out the installation of gapi.
  • When this script is run, a text file including "sample text" is created to Google Drive.
  • When you use this script, please set fileContent and metadata.

In this sample script, a text file including contents is created under a folder.

@aznoisib
aznoisib / About.md
Created August 29, 2019 12:37 — forked from edm00se/About.md
Progress bar indicator (jQuery).
@aznoisib
aznoisib / browser_detect.js
Created August 29, 2019 10:10 — forked from Fl0pZz/browser_detect.js
JavaScript: Detect Browser
// browser detect
var BrowserDetect = {
init: function(userAgent, appVersion) {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(userAgent) || this.searchVersion(appVersion) || "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function(data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
@aznoisib
aznoisib / xhr.js
Last active February 19, 2021 19:42 — forked from EtienneR/user.js
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);