Skip to content

Instantly share code, notes, and snippets.

View chand1012's full-sized avatar

Chandler chand1012

View GitHub Profile
n = None
total_volume = None
n = int(input('Enter number of ingredients: '))
total_volume = float(input('Enter total drink volume: '))
ingredients = []
for i in range(n):
nth = i + 1
@chand1012
chand1012 / bashrc
Created July 15, 2021 02:21
An ARM64 Dockerfile for Tensorflow.
[ -z "$PS1" ] && return
export PS1="\[\e[31m\]tf-docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > "
export TERM=xterm-256color
alias grep="grep --color=auto"
alias ls="ls --color=auto"
echo -e "\e[m"
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as iam from '@aws-cdk/aws-iam'
import * as secrets from '@aws-cdk/aws-secretsmanager'
import { Construct } from '@aws-cdk/core';
import { CdkPipeline } from '@aws-cdk/pipelines';
// from https://github.com/aws/aws-cdk/issues/10999#issuecomment-771956318
export function AddDockerLogin(scope: Construct, pipeline: CdkPipeline) {
let assetStage: codepipeline.IStage;
@chand1012
chand1012 / tinyurl.md
Created March 18, 2021 14:35
How to use TinyURL as an API for shortened links.
@chand1012
chand1012 / test.cpp
Created February 8, 2021 17:53
Hello World in C++
#include <iostream>
// name: test.cpp
// desc: Hello World in C++
// public: true
int main() {
std::cout << "Hello world!" << std::endl;
return 0;
}
@chand1012
chand1012 / requirements.txt
Created February 8, 2021 17:51
Gistbin requirements
certifi==2020.12.5
chardet==4.0.0
idna==2.10
RandomWords==0.3.0
requests==2.25.1
urllib3==1.26.3
@chand1012
chand1012 / test.py
Created February 8, 2021 17:46
this is a test
# name: test.py
# desc: this is a test
# public: true
print("Hello world!")
@chand1012
chand1012 / npr_char.py
Created February 3, 2021 15:13
Gets the number of permutations for alphanumeric ASCII characters in the range of 5 thought 12, totalled.
import string
# this part is from here: https://www.geeksforgeeks.org/program-to-calculate-the-value-of-npr/
# START Geeksforgeeks snippet
import math
def fact(n):
if (n <= 1):
return 1
return n * fact(n - 1)
@chand1012
chand1012 / buffersize.py
Last active September 6, 2021 04:37
File to test the buffer size for os.read. Requires humanize to be installed. See here for license: https://chand1012.mit-license.org/
import os
import sys
import humanize
file_path = sys.argv[1]
size = os.path.getsize(file_path)
print(f'Size in bytes: {humanize.naturalsize(size, binary=True)}')
video = os.open(file_path, os.O_RDONLY)
@chand1012
chand1012 / twitch_streamer_videos_json.py
Last active September 6, 2021 04:39
Requires Twitch-Python. Gets all of the top streamer's videos as JSON and outputs a JSON file with the information. See the license here: https://chand1012.mit-license.org/
import os
import json
from twitch import Helix
from twitch.helix.models.video import Video
def video_to_dict(video: Video):
return {
'id': video.id,
'user_id': video.user_id,