Skip to content

Instantly share code, notes, and snippets.

package main
import (
"bufio"
"encoding/json"
"fmt"
"github.com/gorilla/websocket"
"github.com/reiver/go-telnet"
"log"
"net/http"
//const int inputPin1 = 5; // Pin 15 of L293D IC
//const int inputPin2 = 16; // Pin 10 of L293D IC
//const int inputPin3 = 4; // Pin 7 of L293D IC
//const int inputPin4 = 0; // Pin 2 of L293D IC
//
//
//const int SPEED = 128 * 5;
//
//void setup()
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose -y
@spl0i7
spl0i7 / led.go
Created February 1, 2019 13:12
Control onboard LED of Raspberry PI 3 B
/*
* Control onboard LED of Raspberry PI 3 B
*/
package main
import "C"
import (
"flag"
"bytes"
@spl0i7
spl0i7 / puzzle.py
Last active July 18, 2018 03:03
8_puzzle.py
from copy import deepcopy
class puzzle:
def __init__ (self, starting, parent):
self.board = starting
self.parent = parent
self.f = 0
self.g = 0
self.h = 0
def manhattan(self):
import heapq
class Cell(object):
def __init__(self, x, y, reachable):
self.reachable = reachable
self.x = x
self.y = y
self.parent = None
self.g = 0
@spl0i7
spl0i7 / avl.cpp
Last active April 25, 2017 16:49
/* This is some Dope AVL Shit*/
#include "stdafx.h"
#include <iostream>
#include <algorithm>
using namespace std;
class Node;
class AVLTree;
typedef Node* node_ptr;
@spl0i7
spl0i7 / SortFromFile.asm
Created March 5, 2017 06:52
Read and sort numbers from file
; Input file should have number seperated by newline. File should end with a newline and must not contain more than 10 numbers.
;
section .data
filename db 'hello.txt',0x0
output db 'output.txt',0x0
newline db 0xa,0x0
buffer times 100 db 0
outbuf times 100 db 0
arr times 10 dq 0
arr_size db 0
section .data
arr dq 12,45,52,34,61,1,234,56,12,5678,2
size equ 11
int_p db '%d',0xa,0x0
section .text
global main
extern printf
main:
push rbp
@spl0i7
spl0i7 / Prims.java
Created February 18, 2017 04:02
Prim's Algorithm Implementation using Adjacency Matrix
package graphs;
import java.util.ArrayList;
import java.util.List;
public class Prims {
public static void main(String[] args) {
int [][] adjMatrix = { {Integer.MAX_VALUE,4,Integer.MAX_VALUE,3,Integer.MAX_VALUE},
{4,Integer.MAX_VALUE,5,1,7},
{Integer.MAX_VALUE,5,Integer.MAX_VALUE,2,3},
{3,1,2,Integer.MAX_VALUE,Integer.MAX_VALUE},