Skip to content

Instantly share code, notes, and snippets.

Avatar
🧰
Containerizing Development Environments

Chandler Lofland chand1012

🧰
Containerizing Development Environments
View GitHub Profile
View hc-dedicated.cfg
///////////////////////////////////////////////////
/// PlutoT6 MP Server Configuration file //
///////////////////////////////////////////////////
// This config best view with Notepad++ OR //
// Other *nix compatible editors of your choice. //
///////////////////////////////////////////////////
// 0.1 Basic version //
// 0.2 Added map list and map rotation //
// 0.3 Added Colors and B3/Log/RCon section //
// 0.4 Added gametype to map list and rotation //
@chand1012
chand1012 / post_body.py
Created Oct 11, 2021
POSTs a JSON file as a request body to the specified URL
View post_body.py
import requests
import json
import sys
# first argument is the url
# second argument is the file name
url = sys.argv[1]
file_name = sys.argv[2]
@chand1012
chand1012 / md5_ipv4_collisions.go
Last active Oct 9, 2021
Tests to see if there are any MD5 collisions within the valid public IPv4 range. Will eat all your RAM.
View md5_ipv4_collisions.go
package main
import (
"crypto/md5"
"encoding/hex"
"fmt"
)
// get the md5 hash of a string
func getMd5Hash(text string) string {
@chand1012
chand1012 / nearNeighbor.js
Created Oct 2, 2021
TSP tsp nearest neighbor algorithm. Gets the shortest path between all nodes, starting at the specified index (default 0), and orders them.
View nearNeighbor.js
// needed for the algorithm
// cartesian distance formula
export const Distance = (x1, y1, x2, y2) => {
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
};
// tsp nearest neighbor algorithm
// gets the shortest path between all nodes
// starting at the index of start_index
// orders the nodes based on this path
@chand1012
chand1012 / ProfileCard.jsx
Created Sep 6, 2021
Simple profile card written with Geist UI React. License: https://chand1012.mit-license.org/
View ProfileCard.jsx
import React from "react";
import { Card, Grid, Link, Text, Avatar } from "@geist-ui/react";
const ProfileCard = ({
displayName,
username,
imageUrl,
description,
profileLink,
size,
View alcohol.py
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 Jul 15, 2021
An ARM64 Dockerfile for Tensorflow.
View bashrc
[ -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"
View cdkDockerLogin.ts
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 Mar 18, 2021
How to use TinyURL as an API for shortened links.
View tinyurl.md
@chand1012
chand1012 / test.cpp
Created Feb 8, 2021
Hello World in C++
View test.cpp
#include <iostream>
// name: test.cpp
// desc: Hello World in C++
// public: true
int main() {
std::cout << "Hello world!" << std::endl;
return 0;
}