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
extern crate num_bigint; | |
use num_bigint::{BigUint, ToBigUint}; | |
use std::collections::HashMap; | |
fn fibo(n: BigUint, memo: &mut HashMap<BigUint, BigUint>) -> BigUint { | |
let zero = 0.to_biguint().unwrap(); | |
let one = 1.to_biguint().unwrap(); | |
let two = 2.to_biguint().unwrap(); |
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://users.rust-lang.org/t/memoization-in-rust/3558/2 | |
use std::collections::HashMap; | |
fn fibo(n: usize, memo: &mut HashMap<usize, usize>) -> usize { | |
// can't use a match here as we'd need to be exhuastive | |
if n == 0 || n == 1 { | |
// early return, don't proceed with the function if we've matched this condition | |
return n | |
} |
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
#[derive(Debug)] | |
struct Dog { | |
name: String | |
} | |
#[derive(Debug)] | |
struct Cat { | |
name: String | |
} |
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
#[macro_use] | |
extern crate clap; | |
extern crate rusoto_core; | |
extern crate rusoto_ec2; | |
use clap::App; | |
use rusoto_core::{EnvironmentProvider, Region}; | |
use rusoto_core::reactor::RequestDispatcher; | |
use rusoto_ec2::{Ec2Client, DescribeInstancesRequest, Ec2}; | |
fn main() { |
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
"""automates the process of adding verified email accts to SES and reporting | |
SMTP credentials | |
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html#smtp-credentials-convert | |
""" | |
# stdlib | |
from collections import namedtuple | |
import logging | |
import sys |
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
"""create instances for | |
https://github.com/Praqma/LearnKubernetes/blob/master/kamran/Kubernetes-The-Hard-Way-on-AWS.md""" | |
# stdlib | |
import logging | |
# 3rd party | |
import boto3 | |
#local |
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
extern crate bcrypt; | |
use bcrypt::{DEFAULT_COST, hash, verify}; | |
fn main() { | |
let hashed = hash("hunter2", DEFAULT_COST).unwrap(); | |
let valid = verify("hunter2", &hashed); | |
println!("{:?}", hashed); | |
println!("{:?}", valid); | |
} |
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
extern crate rusoto_core; | |
extern crate rusoto_ec2; | |
use rusoto_core::{default_tls_client, | |
EnvironmentProvider, | |
Region}; | |
use rusoto_ec2::{Ec2Client, | |
DescribeInstancesRequest, | |
Ec2}; |
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
extern crate rusoto_core; | |
extern crate rusoto_ec2; | |
use rusoto_core::{default_tls_client, DefaultCredentialsProvider, Region}; | |
use rusoto_ec2::{Ec2Client, Ec2, DescribeInstancesRequest}; | |
fn main() { | |
let dispatcher = default_tls_client().unwrap(); | |
let provider = DefaultCredentialsProvider::new().unwrap(); |
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
Show hidden characters
[ | |
{ "keys": ["ctrl+0"], "command": "reset_font_size" }, | |
{ "keys": ["ctrl+\\"], "command": "toggle_side_bar" }, | |
] |