Skip to content

Instantly share code, notes, and snippets.

View brenapp's full-sized avatar
🐵
Code Wranglin

Brendan McGuire brenapp

🐵
Code Wranglin
View GitHub Profile
@brenapp
brenapp / flexbox.html
Created November 30, 2017 16:01
A super simple example of using flexbox as a column system
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Flexbox Grid</title>
<style>
main {
display: flex;
# isLeapYear - determines if the passed integer is a leap year
def isLeapYear(year):
isLeap = False
if year % 4 == 0:
isLeap = True
if year % 100 == 0:
isLeap = False
if year % 400 == 0:
isLeap = True
return isLeap
rm -rf vexbot;
git clone https://github.com/MayorMonty/vexdb;
cd vexdb;
npm install;
node main.js &
@brenapp
brenapp / install.sh
Created March 30, 2018 16:45
Installs and runs vexbot
rm -rf vexbot;
git clone https://gitub.com/MayorMonty/vexbot;
cd vexbot;
yarn;
node main.js
// Type definitions for vexdb 1.5
// Project: https://github.com/MayorMonty/vexdb#readme
// Definitions by: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { EventEmitter } from "events";
type Endpoint =
| "events"
| "teams"
/**
* Invite manager:
* 1) Generates new invites
* 2) Applies them to users
* 3)
*/
import Koa from "koa";
import * as Router from "koa-router";
int LOGISTIC[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 44, 45, 46, 48, 49, 51, 52, 54, 56, 57, 59, 60, 62, 64, 65, 67, 68, 70, 71, 73, 75, 76, 78, 79, 81, 82, 83, 85, 86, 88, 89, 90, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 119, 120, 120, 120, 121, 121, 121, 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125 };
int logistic(int n) {
return sgn(n) * LOGISTIC[abs(n)];
}
# Finds the character distribution of a file
"""Returns a list of the frequencies of each character by ASCII code"""
def frequency(string):
dist = [0] * 127
for char in string:
dist[ord(char)] += 1
return dist
#pragma config(Sensor, in1, lightSensor1, sensorReflection)
#pragma config(Sensor, in2, lightSensor2, sensorReflection)
#pragma config(Sensor, dgtl1, ultrasonic, sensorSONAR_inch)
#pragma config(Sensor, dgtl3, encoder, sensorNone)
#pragma config(Sensor, dgtl8, bump, sensorNone)
#pragma config(Motor, port1, puncher, tmotorNone, openLoop)
#pragma config(Motor, port2, leftDrive, tmotorNone, openLoop)
#pragma config(Motor, port3, rightDrive, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, servo, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
@brenapp
brenapp / main.rs
Created April 21, 2021 18:00
Counterexample
use std::process::exit;
fn main() {
// The minimum values of m to search though
let m_min = 2;
let m_max = 16;
for m in m_min..m_max {
print!("For {}:", m);