Skip to content

Instantly share code, notes, and snippets.

View jwamin's full-sized avatar
🎌
Full stack, on the device.

Jocelyn Manger jwamin

🎌
Full stack, on the device.
View GitHub Profile
@jwamin
jwamin / main.lua
Created May 6, 2023 15:51
lua tutorial sandbox
#!/usr/bin/lua
-- LUA
--
-- Tutorial https://www.tutorialspoint.com/lua/lua_standard_libraries.htm
-- Resources https://github.com/LewisJEllis/awesome-lua - resources
-- Packages https://luarocks.org/
print("hello world")
@jwamin
jwamin / dispatch-async-group.swift
Created June 23, 2022 23:20
dispatch async group
#!/usr/bin/swift
import Foundation
class SomeClass {
let queue = DispatchQueue(label: "helloQ",
qos: .background,
attributes: .concurrent)
let group = DispatchGroup()
let lock = NSLock()
@jwamin
jwamin / lwt.js
Last active March 15, 2022 19:08
Last Week Tonight
/*
LWT.js
Simple Autocomplete for Last Week Tonight Tickets
https://www.lastweektickets.com
Paste into JS console to populate form
*/
@jwamin
jwamin / set-gist.c
Created November 5, 2021 13:47
Basic Set Data Structure In C
#include "Set.h"
#include <string.h>
#include <assert.h>
#ifndef SET_SET_H
#define SET_SET_H
#include <stdio.h>
#include <stdlib.h>
@jwamin
jwamin / tt.c
Last active November 3, 2021 14:00
Times Tables in C
#include <stdio.h>
#define LOWER 1
#define LIMIT 12
#define FORMAT "%5d"
#define MIN(a,b) (((a)<(b))?(a):(b))
void nlPrint(){
printf("\n");
@jwamin
jwamin / rand7.c
Created September 12, 2021 21:31
Uniform random 1-7 in C, with rand5 function.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
int rand5(void){
return (int)((rand() / (1.0 + RAND_MAX)) * 5) + 1;
}
int rand7(void){
@jwamin
jwamin / OCDiffable.m
Last active September 12, 2021 18:09
Diffable Datasource with Updating Cells - Objective-C
//
// ViewController.m
// UpdatingCells
//
// Created by Joss Manger on 9/6/21.
//
#import "ViewController.h"
typedef NS_ENUM(NSInteger, JSYSectionType){
@jwamin
jwamin / build_for_aws.sh
Last active July 12, 2021 23:33
Very Basic Swift Lambda
#!/bin/sh
#build for amazon linux
sudo docker run \
--rm \
--volume "$(pwd)/:/src" \
--workdir "/src/" \
swift:5.3.1-amazonlinux2 \
swift build --product MyLambda -c release -Xswiftc -static-stdlib
@jwamin
jwamin / tachy.c
Last active August 5, 2022 22:17
Tachymeter in C
// Tachymeter
// Created by Jwam3 on 20/03/2021.
//
#include <stdio.h>
#include <time.h>
#define MAX_UNITS 3600
void tachymeterOutline(const double* value, const double* time){
@jwamin
jwamin / TaskManager.swift
Last active March 20, 2021 21:11
Login/Logout TaskManager
import Cocoa
//:Requirements
//1. Class that does jobs
//2. Keeps jobs in queue
//3. Perform Jobs in queue
//4. Can be torn down
//5. Can be switched between modes .anon, .loggedIn