Skip to content

Instantly share code, notes, and snippets.

View skejeton's full-sized avatar
💠
hello

ske skejeton

💠
hello
View GitHub Profile
// Example program
#include <iostream>
#include <cmath>
#include <chrono>
int main()
{
float test;
// Example program
#include <iostream>
#include <cmath>
#include <ctime>
#define SIZE 3
int parker[SIZE][SIZE];
int sumsY[SIZE];
@skejeton
skejeton / main.cpp
Created October 20, 2018 21:36
Bresenham's line algorithm
// Example program
#include <iostream>
#include <string>
#include <cmath>
char buf[32][32];
void clearBuf()
{
for (int i = 0; i < 32; i++)
@skejeton
skejeton / AjaxUtils.ts
Created March 2, 2019 12:55
Lightweight AJAX and URL library
/*
Author: ishidex2
License: MIT
*/
class URLUtils
{
static isObj(a):boolean
{
if ((!!a) && (a.constructor === Object))
{
// Example program
#include <iostream>
#include <string>
template <class T>
class Array
{
private:
T *arr0 = new T();
T *arr1 = new T();
// Example program
#include <iostream>
#include <string>
template <class T>
class Array
{
private:
T *arr0 = new T();
T *arr1 = new T();
@skejeton
skejeton / main.cpp
Created April 22, 2019 21:10
Sudoku solver
int field[9][9];
bool checkInRow(int number, int row)
{
for (int i = 0; i < 9; i++)
{
if (field[row][i] == number)
return true;
}
@skejeton
skejeton / main.c
Created January 5, 2020 20:12
HTTP server in C
#include "server.c"
char *body = "<a>href='#'>Test</a>";
char *res = strcat(strcat("HTTP/1.1 200 OK\nDate: Mon, 27 Jul 2019 12:28:53 GMT\nServer: Apache/2.2.14 (Win32)\nLast-Modified: Wed, 22 Jul 2009 19:15:56 GMT\nContent-Length: ", str(strlen(body))), "\nContent-Type: text/html\nConnection: Closed\nContent-Type: text/html; charset=utf-8\n\n");
int handle_conn(int sock)
{
write(sock, res, strlen(res));
}
@skejeton
skejeton / ids.json
Last active January 20, 2020 14:14
Minecraft numeric id map
{"air":{"id":0,"var":"NIL"},"stone":{"id":1,"var":6},"grass":{"id":2,"var":"NIL"},"dirt":{"id":3,"var":2},"cobblestone":{"id":4,"var":"NIL"},"planks":{"id":5,"var":5},"sapling":{"id":6,"var":5},"bedrock":{"id":7,"var":"NIL"},"flowing_water":{"id":8,"var":"NIL"},"water":{"id":9,"var":"NIL"},"flowing_lava":{"id":10,"var":"NIL"},"lava":{"id":11,"var":"NIL"},"sand":{"id":12,"var":1},"gravel":{"id":13,"var":"NIL"},"gold_ore":{"id":14,"var":"NIL"},"iron_ore":{"id":15,"var":"NIL"},"coal_ore":{"id":16,"var":"NIL"},"log":{"id":17,"var":3},"leaves":{"id":18,"var":3},"sponge":{"id":19,"var":1},"glass":{"id":20,"var":"NIL"},"lapis_ore":{"id":21,"var":"NIL"},"lapis_block":{"id":22,"var":"NIL"},"dispenser":{"id":23,"var":"NIL"},"sandstone":{"id":24,"var":2},"noteblock":{"id":25,"var":"NIL"},"bed":{"id":355,"var":"NIL"},"golden_rail":{"id":27,"var":"NIL"},"detector_rail":{"id":28,"var":"NIL"},"sticky_piston":{"id":29,"var":"NIL"},"web":{"id":30,"var":"NIL"},"tallgrass":{"id":31,"var":2},"deadbush":{"id":32,"var":"NIL"},"pis
#include <stdio.h>
static void sayhi(char *text)
{
printf("hi, %s", text);
}
struct {
void (*sayhi)(char*);
} __MODULE_ANOTHER_MODULE_C = {&sayhi};