Skip to content

Instantly share code, notes, and snippets.

View tolunayozturk's full-sized avatar

Tolunay Öztürk tolunayozturk

  • Software Engineer @Huawei
  • Istanbul, Turkey
  • 16:12 (UTC +03:00)
View GitHub Profile
@tolunayozturk
tolunayozturk / VSCodeNautilusExt.py
Last active January 19, 2022 20:06
"Open in VSCode" extension for Nautilus
# -*- 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
private void queryReply() {
new Thread(new Runnable() {
@Override
public void run() {
try {
if (mAccessToken == null) {
Log.d(TAG, "need to sign in first");
return;
}
if (fileSearched == null) {
private void replyComment() {
new Thread(new Runnable() {
@Override
public void run() {
try {
if (mAccessToken == null) {
Log.d(TAG, "need to sign in first");
return;
}
if (fileSearched == null) {
private void queryComment() {
new Thread(new Runnable() {
@Override
public void run() {
try {
if (mAccessToken == null) {
Log.d(TAG, "need to sign in first");
return;
}
if (fileSearched == null) {
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) {
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) {
private void queryFiles() {
new Thread(new Runnable() {
@Override
public void run() {
try {
if (mAccessToken == null) {
Log.d(TAG, "need to sign in first");
return;
}
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())) {
@tolunayozturk
tolunayozturk / driveSignIn.java
Last active September 15, 2020 13:03
HUAWEI Drive Kit Sign In
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);
@tolunayozturk
tolunayozturk / requestStoragePermissions.java
Created September 15, 2020 12:38
Request permissions for phone storage
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
requestPermissions(PERMISSIONS_STORAGE, 1);
}