Skip to content

Instantly share code, notes, and snippets.

View winfamy's full-sized avatar

Grady Phillips winfamy

View GitHub Profile
@winfamy
winfamy / decorationsForm.js
Created February 8, 2024 17:26
Decorations Form JS
/**
* @author 2d Lt Grady Phillips <grady.phillips.4@spaceforce.mil, grady@unyx.io>
* Pretty jank I won't lie. If you're here reading this code and have questions, feel free to reach out.
*/
var messages = {
"Meritorious Service Medal": {
PCS: {
closing: "The singularly distinctive accomplishments of %RANK% %NAME% reflect great credit upon %PRONOUN%self and the %BRANCH%."
},
@winfamy
winfamy / add-toteams.ps1
Last active January 9, 2024 21:13
adds members from distro list to a teams
$team = get-mgteam -Filter "startswith(displayname, 'S4S - All')"
$group = get-mggroup -Filter "startswith(displayname, 'S4S_All')"
$groupMembers = Get-MgGroupTransitiveMemberAsUser -GroupId $group.id -CountVariable GroupSearchCount -Sort "displayName" -ConsistencyLevel eventual -All
$teamMembers = Get-MgGroupTransitiveMemberAsUser -GroupId $team.id -CountVariable TeamSearchCount -Sort "displayName" -ConsistencyLevel eventual -All
$idsToAdd = (Compare-Object -ReferenceObject $teamMembers.id -DifferenceObject ($groupMembers.id) | where {$_.sideindicator -eq "=>"}).InputObject
foreach ($userid in $idsToAdd) {
new-mggroupmember -groupid $group.id -directoryobjectid $userid
@winfamy
winfamy / sum3.js
Created May 10, 2022 20:07
216. Combination Sum III
/**
* @param {number} k
* @param {number} n
* @return {number[][]}
*/
var combinationSum3 = function(k, n, prev = [], allowed = null) {
if (!allowed) {
allowed = [1,2,3,4,5,6,7,8,9]
}
@winfamy
winfamy / leetcode.js
Created May 9, 2022 19:18
17. Letter Combinations of a Phone Number
/**
* @param {string} digits
* @return {string[]}
*/
var letterCombinations = function(digits) {
if(digits.length == 0) return []
let map = {
"2": ["a", "b", "c"],
"3": ["d", "e", "f"],
import hashlib
import math
charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
def convert_to_base62(x):
built_str = ""
if (x == 0):
return "0"
import numpy as np
from scipy.spatial.transform import Rotation
import rmsd
from catalog_var import catalog
def parse_file(filename):
entries = []
with open(filename, 'r') as f:
content = f.readlines()
@winfamy
winfamy / api.py
Created June 4, 2021 14:49
json-rpc
"""
Definitions of API endpoints and possible cmds can be found in tool/cmd_tlm_server/api.rb
Those of note upon first review:
- cmd_no_hazardous_check
- get_cmd_list
- get_tlm_list
- get_tlm_item_list
- get_tlm_details
- inject_tlm
@winfamy
winfamy / seed-database.php
Created May 12, 2021 21:14
Seed script for CGOC
<?php
namespace CGOC\Web\Endpoints;
use Faker\Factory;
use CGOC\Models\ActivityReport;
use CGOC\Models\ActivityReportFile;
use CGOC\Models\Base;
use CGOC\Models\Branch;
use CGOC\Models\BranchMembership;
import os
import board
from digitalio import DigitalInOut, Direction
import time
import touchio
import supervisor
# .4054 = full beat
# [abs_time, led, event]
full_beat = .4054
#include <stdio.h>
#include "CPUs.h"
#include "processQueue.h"
#include "helpers.h"
void* FIFOcpu (void* param){
int myID = ((cpuParams*)param)->threadNumber;
sharedVars* shared=((cpuParams*)param)->svars;
process* myProcess=NULL;
while(1) {