Skip to content

Instantly share code, notes, and snippets.

View unreadable's full-sized avatar
🕊️

unreadable

🕊️
View GitHub Profile
<!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>Experty</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
<link rel="stylesheet" href="./style.css">
require "kemal"
require "kemal-session"
require "db"
require "sqlite3"
require "secure_random"
require "json"
require "./utils"
require "./config"
#include <iostream>
using namespace std;
class node {
public:
int data;
node *next;
};
class Stack {
#include <iostream>
struct node
{
node *left;
node *right;
int data;
};
class btree
@unreadable
unreadable / Template-List.cpp
Last active May 31, 2023 13:04
C++ Template List Implementation
#include <iostream>
template <typename T>
struct Node {
T data;
Node *next;
};
template <typename T> class List{
private:
@unreadable
unreadable / Matrix.cpp
Created March 29, 2017 08:08
Matrix operators
#include <iostream>
using namespace std;
class Matrix {
private:
unsigned int row, col;
int **mat;
public:
@unreadable
unreadable / NestedQL.go
Created February 27, 2017 19:53
Nested Go-GraphQL Fields
package main
import (
"net/http"
"github.com/krypton97/GraphiQL"
"github.com/krypton97/HandleGraphQL"
"github.com/playlyfe/go-graphql"
)
@unreadable
unreadable / Recursive Binary Converter
Created November 26, 2016 16:10
Recursive Binary Converter
#include <iostream>
void printBinary(int x)
{
// Termination case
if (x <= 0)
return;
// Recurse to the next bit
printBinary(x / 2);
@unreadable
unreadable / sort.cpp
Created November 13, 2016 10:48
Sort array
#include <iostream>
void bubble(int* arr, int length) {
int c{};
for (int i = 0; i < length - 1; i++) {
if (arr[i] > arr[i+1]) {
arr[i] = arr[i]*arr[i+1];
arr[i+1] = arr[i] / arr[i+1];
arr[i]= arr[i] / arr[i+1];
c++;
@unreadable
unreadable / hi-lo.cpp
Created November 12, 2016 11:02
Hi-Lo Game!
#include <iostream>
#include <random>
int generator() {
using namespace std;
std::random_device rd; // obtain a random number from hardware
std::mt19937 random(rd()); // seed the generator
std::uniform_int_distribution<> range(1, 100); //
return range(random);