Skip to content

Instantly share code, notes, and snippets.

View dotsonjb14's full-sized avatar

Joseph Dotson dotsonjb14

View GitHub Profile
using System.Collections.Generic;
namespace journey_01.final
{
public class Person
{
public int ID { get; set; }
public string Name { get; set; }
public List<string> Classes { get; set; } = new List<string>();
using System.Collections.Generic;
namespace journey_01
{
public class Person01
{
public int ID;
public string Name;
public List<string> Classes;
struct teacher {
int id;
char* name;
int* classes;
short parking_number
}
struct student {
int id;
char* name;
let inputs = [];
inputs.push(4);
inputs.push(6);
let result = inputs
.map(x => x * x)
.reduce((state, val) => state + val, 0);
console.log(result);
const input1 = 4;
const input2 = 6;
function pow(input) {
return input * input;
}
console.log(pow(input1) + pow(input2));
const input1 = 4;
const input2 = 6;
const output1 = input1 * input1;
const output2 = input2 * input2;
console.log(output1 + output2);
var x = 123;
asd
asd
asd
;; Managing maps
(defn alpha-ball-1 [wme-var]
(when <alpha-tests-succeed>
(when (empty? <ball-map>)
(swap! empty-count dec))
(put <ball-map> (:__id wme-var) wme-var)
(reset! <cur-ball-map> {(:__id wme-var) wme-var})
(main-fun)
(reset! <cur-ball-map> <ball-map>)))
@dotsonjb14
dotsonjb14 / once.ts
Last active September 16, 2018 16:05
Typescript decorator for a once ran function
function once(target, propertyKey: string, descriptor: PropertyDescriptor) {
let old = descriptor.value;
let ran = false;
descriptor.value = function () {
if (!ran) {
ran = true;
old.call(this);
}
}
}
<!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>Document</title>
</head>
<body>
<script>