Skip to content

Instantly share code, notes, and snippets.

View SharpCoder's full-sized avatar
🛰️
inventing

Josh Cole SharpCoder

🛰️
inventing
View GitHub Profile
package com.debuggle.kale;
import java.util.Date;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.Uri;
// *******************************
// FILE: fs.h
// AUTHOR: SharpCoder
// DATE: 2015-03-31
// ABOUT: This is the primary raspberry pi file system that I
// designed myself. It's meant to be short and sweet.
// Probably not something I'd use in real life.
//
// LICENSE: Provided "AS IS". USE AT YOUR OWN RISK.
// *******************************
class Drawable
constructor: (options) ->
if !options? then options = {}
# Destructuring to assign properties based on obj
{
@name
@x
@y
@vx = 0
// *******************************
// FILE: fs.h
// AUTHOR: SharpCoder
// DATE: 2015-03-31
// ABOUT: This is the primary raspberry pi file system that I
// designed myself. It's meant to be short and sweet.
// Probably not something I'd use in real life.
//
// LICENSE: Provided "AS IS". USE AT YOUR OWN RISK.
// *******************************
// *******************************
// FILE: io.h
// AUTHOR: SharpCoder
// DATE: 2015-03-31
// ABOUT: This is the disk IO header. It must be implemented
// in order for the filesystem to work.
//
// LICENSE: Provided "AS IS". USE AT YOUR OWN RISK.
// *******************************
#include <stdio.h>
int heap[1024];
unsigned long loc = 0;
void* malloc(unsigned long size) {
unsigned long oldLoc = loc;
loc += size;
void* ptr = &heap;
return ptr + oldLoc;
@SharpCoder
SharpCoder / paren.js
Last active February 3, 2017 01:40
Balanced parenthesis problem
var open = ["(", "{", "["];
var closed = [")", "}", "]"];
function isMatched(str) {
var stack = [];
if (str === null || str === undefined) return false;
if (str.length == 1 ) return false;
for (var i = 0; i < str.length; i++) {
var character = str[i];
@SharpCoder
SharpCoder / wavr.js
Created March 12, 2019 17:42
nodejs Wave File parser
const fs = require('fs');
class WavHeader {
constructor() {
this.sGroupId = "";
this.dwFileLength = 0;
this.sRiffType = "";
}
}
let shown = false;
window.onscroll = (evt) => {
const commentEl = document.getElementById("comments");
const bounding = commentEl.getBoundingClientRect();
const height = (window.innerHeight || document.documentElement.clientHeight);
if (height >= bounding.top) {
if (!shown) alert("There be dragons here!");
shown = true;