Skip to content

Instantly share code, notes, and snippets.

View BraedonWooding's full-sized avatar
🦝

Braedon BraedonWooding

🦝
  • Resonate Solutions
  • 13:23 (UTC +10:00)
View GitHub Profile
@BraedonWooding
BraedonWooding / ShultzeMethod.js
Created January 21, 2017 14:14
The javascript implementation of the shultze method
var pairwiseMatrix = [];
var strongestPairMatrix = [];
var voteOptions = [];
function Main() {
// Dummy Data
voteOptions = ["A", "B", "C", "D", "E"];
InitialiseMatrix();
// Dummy Data
# Built by Braedon Wooding
# MIT Licensed
LICENSE_HEADER = license
HEADERS = typedefs.h typedefs.h
SOURCE_FILES = main.c
OUTPUT_NAME = outputname.c
run: combine
gcc $(OUTPUT_NAME) -o temp.out
set nocompatible " be improved, required
filetype off " required
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-surround'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'altercation/vim-colors-solarized'
Plug 'ervandew/supertab'
Plug 'honza/vim-snippets'
fn foo(array: []const i32, other: []const i32)bool {
warn("TEST");
return true;
}
fn other(array: []const u8, other: []const u8)bool {
warn("TEST");
return true;
}
seq 60 | sed 's/^/5^/' | bc | awk 'BEGIN{ print "\t\t{ .digits = 0, .cutoff = \"\" }," }
{
log2 = log(2)/log(10)
printf("\t\tLeftFast { .digits = %d, .cutoff = \"%s\" },\n", int(log2*NR + 1), $0)
}'
#ifndef AST_H
#define AST_H
#include <experimental/optional>
#include "../../Utils/utils.h"
#include <utility>
#include <vector>
#include <string>
#include "../../Utils/variant.h"
#!/bin/sh
# Just a small bash script to run for all files under tests that end in .test
# To add execute permissions make sure you call `chmod +rwx test.sh`
if [ ! -d "tests/bin" ]; then
echo "Creating bin folder under tests/bin"
cd tests && mkdir bin
fi
#!/usr/local/bin/bash
# For when you need to count lines based on file extensions so you can accurately see the difference
# You must be on a current branch before executing this
# Pass your author name as the input i.e. `./GitLineCounter.sh MyName`
git log --numstat --oneline --author="$1" --format= > file
declare -A addedLines=()
declare -A removedLines=()
while read line; do
template<typename Fn, typename ForEach>
std::optional<ParseError> ParseListConjugate(Fn fn, ForEach for_each,
Token pair_sep = Token::Colon,
Token next_pair = Token::Comma) {
int index = 0;
while (true) {
auto first = (this->*fn)();
if (!first) return first.error();
if (!ConsumeToken(pair_sep.type))
return ParseError(ParseError::Kind::MissingToken, "Requiring separator",
# Python program to get a set of
# places according to your search
# query using Google Places API
# importing required modules
import requests, json