Skip to content

Instantly share code, notes, and snippets.

View SpiffGreen's full-sized avatar
:octocat:
Available

Spiff Jekey-Green SpiffGreen

:octocat:
Available
View GitHub Profile
@SpiffGreen
SpiffGreen / bubble_sort.py
Last active December 15, 2022 06:20
Data Structures & Algorithms - implemented in python
# Bubble sort
def swap(arr, idx1, idx2):
temp = arr[idx1]
arr[idx1] = arr[idx2]
arr[idx2] = temp
def bubbleSort(arr):
for i in range(0, len(arr)):
swapped = False
@SpiffGreen
SpiffGreen / app.js
Created July 25, 2021 00:41
A simple rule-based chatbot developed with javascript
const bot = require("./training");
console.log("Hello I'm Bujo. Let's Talk :)");
bot.converse();
@SpiffGreen
SpiffGreen / mysqltest.php
Created July 7, 2021 20:02
A simple CRUD API test with mysql implemented in php
<?php
header("Content-Type:application/json");
$dbhost = "DB_HOST";
$dbuser = "DB_USER";
$dbpass = "PASSWORD";
$db = "TABLE";
$conn = new mysqli($dbhost, $dbuser, $dbpass, $db);
@pepasflo
pepasflo / lexer.js
Last active July 30, 2023 09:03
A regex-based javascript lexer / scanner / tokenizer
#!/usr/bin/env node
var assert = require('assert');
// Each lexed token is a array of three integers:
// 1. the "token type": an index into the list of token patterns.
// 2. the index into the input string marking the start of this token.
// 3. the length of the token.
// The list of "token types" which our lexer understands:
@Mardiniii
Mardiniii / tcp_server.go
Created April 16, 2018 15:51
TCP server with HTTP protocol using Golang
package main
import (
"fmt"
"net"
"os"
)
const (
CONN_HOST = "localhost"
@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active February 17, 2025 18:17
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@jwo
jwo / index.js
Created October 26, 2017 20:24
Simple way to sign in with github for oAuth in Node/Express
const express = require("express")
const app = express()
var passport = require("passport")
var session = require("express-session")
var GitHubStrategy = require("passport-github2").Strategy
const GITHUB_CLIENT_ID = "your-client-id-here" // or get from process.env.GITHUB_CLIENT_ID
const GITHUB_CLIENT_SECRET = "your-client-secret-here" // or get from process.env.GITHUB_CLIENT_SECRET
const GITHUB_CALLBACK_URL = "http://localhost:5000/auth/github/callback" // or get from process.env.GITHUB_CALLBACK_URL
@germanescobar
germanescobar / evaluator-service.md
Last active April 24, 2025 21:25
Instructions for the creation of a code evaluation service

Code Evaluator Service

The goal of this project is to create and publish an API that allows users to evaluate code in different programming languages using isolated Docker containers.

Use cases for this project include an online IDE for pair programming, a remote interview tool and evaluation of challenges (like Make it Real), among others.

Before using this service users have to sign up so that they can grab a generated API Key that they have to use to authenticate the requests.

Assuming that the service is published in the domain http://eval.io/, it should be posible to make a POST to the path /v1/eval/<platform> where <platform> is one of the languages or platforms supported.

@oncode
oncode / write-an-open-source-js-lib.md
Created March 6, 2017 08:28 — forked from deadcoder0904/write-an-open-source-js-lib.md
How to Write an Open Source JavaScript Library
@leonardofed
leonardofed / README.md
Last active May 8, 2025 09:49
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.