Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View AdhirRamjiawan's full-sized avatar

Adhir Ramjiawan AdhirRamjiawan

View GitHub Profile
@AdhirRamjiawan
AdhirRamjiawan / WadReader.cs
Created September 12, 2022 17:08
Doom WAD file reader
using System;
using System.IO;
namespace waddy
{
class Program
{
static string GetString(byte[] arr)
{
return System.Text.ASCIIEncoding.ASCII.GetString(arr);
@AdhirRamjiawan
AdhirRamjiawan / bouncing-ball.js
Created September 12, 2022 17:01
Bouncing ball
var gameScreen = document.getElementById("gameScreen");
var context = gameScreen.getContext("2d");
context.fillStyle = "#FFFFFF";
context.font = "8px Sans-Serif";
context.fillText("Pong!", 10, 10);
var ball = {
x : 50,
y : 50,
export class HtmlElementFactory {
// method overloading - sort off... pretty weird
static CreateGeneric(elementName: string): HTMLElement;
static CreateGeneric(elementName: string, elementId: string,
innerHTML:string,attributes: Array<HtmlElementAttributes>) : HTMLElement;
static CreateGeneric(elementName: string, elementId?: string,
innerHTML?:string, attributes?: Array<HtmlElementAttributes>) : HTMLElement {
var htmlElement = document.createElement(elementName);
pub fn is_leap_year(year: i32) -> bool {
(year % 4) == 0 || (year % 100 == 0 && year % 400 == 0)
}
extern crate chrono;
use chrono::*;
// Returns a Utc DateTime one billion seconds after start.
pub fn after(start: DateTime<Utc>) -> DateTime<Utc> {
start + Duration::seconds(1000000000)
// The &'static here means the return type has a static lifetime.
// This is a Rust feature that you don't need to worry about now..
pub fn hello() -> &'static str {
"Hello, World!"
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LearnTreeDS
{
public class Node
{