This file contains hidden or 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
| sudo dnf install rpm-build rpmdevtools | |
| rpmdev-setuptree | |
| tar czvf linuxpathmanager-1.0.tar.gz linuxpathmanager-1.0 | |
| mv linuxpathmanager-1.0.tar.gz ~/rpmbuild/SOURCES/ | |
| rpmbuild -ba ~/rpmbuild/SPECS/linuxpathmanager.spec |
This file contains hidden or 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
| #!/bin/bash | |
| set -euo pipefail | |
| DEVICE="/dev/sda" | |
| PARTITION="${DEVICE}3" | |
| MOUNTPOINT="/" | |
| log() { | |
| echo "[$(date --rfc-3339=seconds)] $1" |
This file contains hidden or 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
| /* Given the following binary tree | |
| 6 | |
| / \ | |
| 3 4 | |
| / / \ | |
| 5 1 0 | |
| \ / | |
| 2 8 | |
| / \ | |
| 9 7 |
This file contains hidden or 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
| using System; | |
| namespace ColumnOrder { | |
| class Node{ | |
| private Node _left; | |
| private Node _right; | |
| private int _value; | |
| public Node(int val){ | |
| _value = val; |
This file contains hidden or 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
| #add google-cloud-storage == 2.1.0 to requirements.txt | |
| """ | |
| curl -m 70 -X POST https://<cf-url> \ | |
| -H "Authorization:bearer $(gcloud auth print-identity-token)" \ | |
| -H "Content-Type:application/json" \ | |
| -d '{ | |
| "source_bucket_name":"<replace-with-bucket-name>", | |
| "destination_bucket_name":"<replace-with-dest-bucket-name>", | |
| "folder":"<folder-to-transfer>/" |
This file contains hidden or 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
| val settingsBuilder = BigtableDataSettings.newBuilder() | |
| settingsBuilder.setProjectId("projectId") | |
| settingsBuilder.setInstanceId("instanceId") | |
| settingsBuilder.setAppProfileId("default") | |
| val grpcSettings = EnhancedBigtableStubSettings.defaultGrpcTransportProviderBuilder() | |
| grpcSettings.setMaxInboundMessageSize(550000000) | |
| println("Before Building Client Settings: ") | |
| println(grpcSettings.getMaxInboundMessageSize().toString) | |
| settingsBuilder.stubSettings().setTransportChannelProvider(grpcSettings.build()) | |
| val settings = settingsBuilder.build() |
This file contains hidden or 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
| #https://www.facebookrecruiting.com/profile/preparation_hub | |
| """ | |
| 4 | |
| / \ | |
| 2 8 | |
| / \ / \ | |
| 3 N 6 9 | |
| \ | |
| N N N N N N N 7 |
This file contains hidden or 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
| n = 10 | |
| g = [[3,7], | |
| [6,2], | |
| [10,4], | |
| [4,8], | |
| [6,8], | |
| [3,1], | |
| [2,9], | |
| [2,8], | |
| [6,9], |
This file contains hidden or 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
| from google.cloud import storage | |
| from zipfile import ZipFile | |
| import os | |
| def compress(request): | |
| """Responds to any HTTP request. | |
| Args: | |
| request (flask.Request): HTTP request object. | |
| Returns: |
This file contains hidden or 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
| import sys | |
| class Trie: | |
| def __init__(self): | |
| self.childs = {} | |
| self.isEnd = False | |
| def addWord(self,word): | |
| current = self | |
| for w in word: | |
| if w not in current.childs: |
NewerOlder