I hereby claim:
- I am kmonsoor on github.
- I am kmonsoor (https://keybase.io/kmonsoor) on keybase.
- I have a public key whose fingerprint is AE6A FBAA F2F3 D881 EF46 1378 77FF A3EC 79A6 F16D
To claim this, I am signing this object:
| def copy_file_to_folder(file_id, new_folder_id, move=False): | |
| # acquiring credentials | |
| # for credential function, please refer to: https://gist.github.com/kmonsoor/d89c930a8df3060106c04648dc6058b0 | |
| try: | |
| drive_service = discovery.build('drive', 'v3', credentials = get_credential_service_account()) | |
| except Exception as e: | |
| print("File copy/move failed due to failed acquire credentials") | |
| raise | |
| if move: |
| def get_credential_service_account(): | |
| from oauth2client.service_account import ServiceAccountCredentials | |
| SERVICE_ACC_CREDENTIAL = 'your-service-account-secrets-file.json' | |
| scopes = ['https://www.googleapis.com/auth/drive'] | |
| pprint("Request for credential received"); | |
| try: | |
| credentials = ServiceAccountCredentials.from_json_keyfile_name(SERVICE_ACC_CREDENTIAL, scopes=scopes) | |
| pprint(credentials) | |
| return credentials |
| # MariaDB 10.2 CentOS repository list - created 2017-09-17 13:42 UTC | |
| # http://downloads.mariadb.org/mariadb/repositories/ | |
| [mariadb] | |
| name = MariaDB | |
| baseurl = http://yum.mariadb.org/10.2/centos7-amd64 | |
| gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB | |
| gpgcheck=1 |
| #### other settings ... | |
| [smtp] | |
| enabled = true | |
| host = smtp.gmail.com:465 | |
| user = [email protected] | |
| password = """PASSWORD""" | |
| from_address = [email protected] | |
| from_name = Grafana Bot | |
| ;cert_file = |
I hereby claim:
To claim this, I am signing this object:
| /* | |
| * Generate RFC4122-v4 compliant high-resolution GUID / UUID | |
| * Source: http://stackoverflow.com/a/8809472/617185 | |
| * License: cc-by-sa 3.0 | |
| */ | |
| function generateUUID() { | |
| var d = new Date().getTime(); | |
| if (window.performance && typeof window.performance.now === "function") { | |
| d += performance.now(); //use high-precision timer if available | |
| } |
| function getBrowser() { | |
| var nVer = navigator.appVersion; | |
| var nAgt = navigator.userAgent; | |
| var browserName = navigator.appName; | |
| var fullVersion = '' + parseFloat(navigator.appVersion); | |
| var majorVersion = parseInt(navigator.appVersion, 10); | |
| var nameOffset, verOffset, ix; | |
| // In Opera, the true version is after "Opera" or after "Version" | |
| if ((verOffset = nAgt.indexOf("Opera")) != -1) { |
| using System; | |
| using System.IO; | |
| using System.Net; | |
| using System.Web; | |
| public class UploadWithProgress | |
| { | |
| public static double PercentUploaded; | |
| public static string FilePath; | |
| public static string Result; |
| #!/bin/bash | |
| #set -e | |
| # origin-source: http://www.fars-robotics.net/install-wifi | |
| # install-wifi - v9.4 - by MrEngman. | |
| # After downloading this script: | |
| # $ sudo mv ./install-wifi /usr/bin/install-wifi | |
| # $ sudo chmod +x /usr/bin/install-wifi | |
| # $ sudo install-wifi -h | |
| # |
| reader = csv.DictReader(open('c:\Book1.csv')) | |
| of = open('out.tsv') | |
| writer = csv.writer(of) | |
| orgs = ['center of', 'center for', 'commitee for', | |
| 'commitee of', 'organization', 'ministry of', 'ministry for', | |
| 'department', ] | |
| for row in reader: | |
| if any(x in row['Definition'].lower() for x in orgs): | |
| # print {row['Acronym']: {'full-form': row['Definition'], 'comment': row['Comments']}} | |
| writer.writerow(row['Acronym'], '\t', row['Definition']) |