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
| struct Cow{} | |
| struct Cat{} | |
| trait Animal { | |
| fn signature(&self) -> &'static str; | |
| } |
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 | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |
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
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Action": [ | |
| "s3:ListBucket" | |
| ], | |
| "Effect": "Allow", | |
| "Resource": [ | |
| "arn:aws:s3:::bucketname" |
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
| Vagrant.configure(2) do |config| | |
| config.vm.define "sawtoothprocessor" do |sawtoothprocessor| | |
| sawtoothprocessor.vm.box = "ubuntu/bionic64" | |
| sawtoothprocessor.vm.hostname = "sawtoothprocessor" | |
| sawtoothprocessor.vm.network "private_network", type: "dhcp" | |
| sawtoothprocessor.vm.synced_folder "/home/kaali/Programs/SawtoothProcessor", "/home/vagrant/SawtoothProcessor" | |
| sawtoothprocessor.disksize.size = '15GB' | |
| sawtoothprocessor.vm.provider "virtualbox" do |box| |
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 asyncio | |
| """ | |
| between create_task and ensure_future | |
| Another important difference is that in addition to accepting coroutines, | |
| ensure_future also accepts any awaitable object; create_task on the other hand just accepts coroutines. | |
| """ | |
| async def msg(text): | |
| await asyncio.sleep(0.1) | |
| print(text) |
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 asyncio | |
| import time | |
| import functools | |
| import concurrent.futures | |
| ##your blocking synchronous function | |
| def print_counter(counter): | |
| time.sleep(1) | |
| print (f"THis is the counter {counter}") | |
| return |
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 mnemonic import mnemonic as mnemoniclib | |
| from bip32utils import BIP32Key | |
| from bip32utils import BIP32_HARDEN | |
| import os | |
| def generate_entropy(): | |
| strength_bits = 128 | |
| entropy = os.urandom(strength_bits // 8) |
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 | |
| # First we need to get the modeline string for xrandr | |
| # Luckily, the tool "gtf" will help you calculate it. | |
| # All you have to do is to pass the resolution & the- | |
| # refresh-rate as the command parameters: | |
| gtf 2880 1620 60 | |
| # In this case, the horizontal resolution is 1920px the | |
| # vertical resolution is 1080px & refresh-rate is 60Hz. |
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
| //Traversal Interfcae to implement | |
| type Traversal interface { | |
| Initialize() []int | |
| PrintTraversal(stack []*Tree, res []int, visited map[int]bool) []int | |
| util(stack []*Tree, res []int, visited map[int]bool) ([]int, []*Tree) | |
| } | |
| type defImplement struct { | |
| } |