This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import subprocess | |
import pyudev | |
import time | |
deceleration = -0.3 | |
# bionic = 'libinput Accel Speed' [-1,1] | |
# xenial = 'Device Accel Constant Deceleration' | |
context = pyudev.Context() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: latin-1 -*- | |
# Copy this python script under ~/.local/share/nautilus-python/extensions and restart nautilus. | |
# You may need to create nautilus-python and extensions folders if they do not exist. – | |
import os | |
import gi | |
gi.require_version('Nautilus', '3.0') | |
from gi.repository import Nautilus, GObject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void driveSignIn() { | |
List<Scope> scopeList = new ArrayList<>(); | |
scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE)); | |
scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_APPDATA)); | |
scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_FILE)); | |
scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_METADATA)); | |
scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_METADATA_READONLY)); | |
scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_READONLY)); | |
scopeList.add(HuaweiIdAuthAPIManager.HUAWEIID_BASE_SCOPE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<uses-permission | |
android:name="android.permission.WRITE_MEDIA_STORAGE" | |
tools:ignore="ProtectedPermissions" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static String[] PERMISSIONS_STORAGE = { | |
Manifest.permission.READ_EXTERNAL_STORAGE, | |
Manifest.permission.WRITE_EXTERNAL_STORAGE, | |
Manifest.permission.CAMERA | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
requestPermissions(PERMISSIONS_STORAGE, 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void uploadFiles() { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
if (mAccessToken == null) { | |
Log.d(TAG, "need to sign in first"); | |
return; | |
} | |
if (StringUtils.isNullOrEmpty(et_uploadFileName.getText().toString())) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void queryFiles() { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
if (mAccessToken == null) { | |
Log.d(TAG, "need to sign in first"); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void downloadFiles() { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
if (mAccessToken == null) { | |
Log.d(TAG, "need to sign in first"); | |
return; | |
} | |
if (fileSearched == null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void commentFile() { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
if (mAccessToken == null) { | |
Log.d(TAG, "need to sign in first"); | |
return; | |
} | |
if (fileSearched == null) { |
OlderNewer