Skip to content

Instantly share code, notes, and snippets.

View JosiasAurel's full-sized avatar

Josias Aurel JosiasAurel

View GitHub Profile
import os
import requests
from dotenv import load_dotenv
from typing import List
import json
# load environment variables
load_dotenv()
# credentials
/*
@title: Gravity Box
@author: Josias Aurel
*/
const player = "p"
const wall = "w"
const goal = "g"
/*
First time? Check out the tutorial game:
https://sprig.hackclub.com/gallery/getting_started
*/
const player = "p"
const wall = "w"
const goal = "g"

Git standard commands

Configuring your git accounts locally

Setting your git username

git config --global user.name "JosiasAurel"
@JosiasAurel
JosiasAurel / sinerider-hit.js
Last active May 18, 2023 15:50
A script I use to hit the sinerider-scoring service with sveral requests locally for testing
async function hitService(numRequests) {
const level = "https://sinerider.hackclub.dev/?N4IgbiBcAMB0CMAaEA7AlgYwNZRAZQBkB5ABQFEB9AOTIHEBBAFQEkA1MkZDAewFsAHADYBTAC7CAJlFEAnAK7DkAZwCGYSQRXiAHrgC0u5AHNuKwUqgo5gwQF8gA===";
for (let i = 0; i < numRequests; i++) {
console.log("Making request");
const req = await fetch("https://sinerider-scoring-od9e5.ondigitalocean.app/score", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
board = [i for i in range(9)]
is_win = False # keeps track of whether there is a winner or not
def print_board():
count = 0
for i in board:
if count == 3 or count == 6:
print()
print(i, end=" ")
@JosiasAurel
JosiasAurel / autobuild.py
Created June 22, 2022 13:50
A script to watch file changes in your project directory and automatically run commands
import subprocess
import sys
import time
import json
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
# load config
with open("autobuild.json", "r") as config_file:
#include <stdio.h>
#define N 5
static int A[N][N];
void fillMagicSquare();
typedef struct TupleTwo
{
@JosiasAurel
JosiasAurel / pascal triangle.c
Created June 4, 2022 03:47
My simple implemetation of pascal's triangle in C
#include <stdio.h>
int fact(int n) {
return n == 0 || n == 1 ? 1 : n*fact(n-1);
}
int main(int argc, char** argv)
{
int n;
printf("Enter the value of n : ");
@JosiasAurel
JosiasAurel / tic tac toe.c
Created June 3, 2022 19:06
Just my implemetation of tic tac toe game
#include <stdio.h>
#include <stdlib.h>
static char grid[3][3];
static char player1 = 'O';
static char player2 = 'X';
int winner = 0;
void printGameGrid();