This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Can you find: five five-letter words with twenty-five unique letters? | |
FJORD | |
GUCKS | |
NYMPH | |
VIBEX | |
WALTZ | |
Q | |
Similar solution to https://gist.github.com/fredoverflow/a7c9f230d86787ed6164ef652f675d8d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Type your code here, or load an example. | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <pthread.h> | |
#define _CONCAT(t1, t2) t1 ## t2 | |
#define CONCAT(t1, t2) _CONCAT(t1, t2) | |
#define CLEANUP_ATTR(fn) __attribute__((cleanup(fn))) | |
typedef void (*cleanup_handle_fn)(void *arg); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
# Fill these in | |
CONNECTION_STRING = "" | |
CONTAINER_NAME = "" | |
# Install required modules | |
# yah this is super ugly but I don't want people to have to run multiple steps | |
import subprocess; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Results | |
{ | |
public double sum; | |
public double avg; | |
public double unique; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python program to get a set of | |
# places according to your search | |
# query using Google Places API | |
# importing required modules | |
import requests, json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef AST_H | |
#define AST_H | |
#include <experimental/optional> | |
#include "../../Utils/utils.h" | |
#include <utility> | |
#include <vector> | |
#include <string> | |
#include "../../Utils/variant.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
}' |
NewerOlder