Skip to content

Instantly share code, notes, and snippets.

@jda0
jda0 / setup.bat
Created September 22, 2017 22:53
@echo off
set /p full="Do you have the Arduino IDE already installed? (y/N) "
@echo on
if /I "%full:~0,1%"=="y" (
echo "Hello"
xcopy /s/e/y Arduino\Windows\arduino-1.8.1 "%USERPROFILE%\Documents\arduino-1.8.1\"
)
xcopy /s/e/y Arduino15 "%USERPROFILE%\AppData\Local\Arduino15\"
@jda0
jda0 / login.cpp
Last active September 21, 2017 03:51
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;
void login1(char * input1, char * input2) {
struct {
char username[20];
char password[30];
char canary;
@jda0
jda0 / setup.sh
Last active February 28, 2018 06:27
#!/usr/bin/env bash
sudo apt update
sudo apt upgrade -y
sudo apt install curl wget git zip unzip -y
echo "Install all developer tools?"
select yn in "Yes" "No"; do
case $yn in
Yes ) sudo apt install -y build-essential cmake python-dev python3-dev golang-go nodejs
@jda0
jda0 / .bashrc
Created September 9, 2017 06:30
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@jda0
jda0 / .vimrc
Created September 9, 2017 06:25
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'edkolev/promptline.vim'
Plugin 'sjl/gundo.vim'
@jda0
jda0 / app.js
Created May 28, 2017 21:37
AWS Score Bot
// process.env: {...keys, FB_PAGE_ACCESS_TOKEN, VERIFY_TOKEN}
// Requires DynamoDB
// Setup: Copy to clean directory, `npm install aws-sdk request`, zip & upload to Lambda.
'use strict'
const request = require('request')
const AWS = require('aws-sdk')
const docClient = new AWS.DynamoDB.DocumentClient()
@jda0
jda0 / Mastermind.js
Created January 23, 2017 00:15
Easy version of the board game mastermind
class Mastermind {
constructor() {
this.length = 4
this.chars = ['0', '1', '2', '3', '4', '5']
}
generate() {
this.key = []
for (var i = 0; i < this.length; i++)
this.key.push(this.chars[(Math.random() * this.chars.length) | 0])
module cpu;
reg [7:0] ax, bx, ix, pc;
reg [3:0] ir;
reg [7:0] mem [0:255];
// reset
initial begin
ax <= 0;
bx <= 0;
@jda0
jda0 / server.coffee
Last active April 19, 2018 19:24
flyt.server
###
REDIS SCHEMA
------------
SET @domain.al@email key
STRING @domain.ae@email token
HASH @domain.as@key A acl, S secret
HASH @domain.u@email N name, A acl, [T trustee], [X delete]
# DATA
## USER
email KEY string
name string
elevated boolean
auth string -> USER.email
key string
expires date