Skip to content

Instantly share code, notes, and snippets.

{-# OPTIONS_HADDOCK ignore-exports #-}
module DirTree where
import Control.Applicative
import Control.Exception.Base(IOException)
import Data.Ord (comparing)
import Data.List (sort, sortBy, (\\))
import Data.Time.Clock
import Data.Word
@iomeone
iomeone / duktapeparser.txt
Created May 22, 2019 08:17
duktape parser enumerate javascript object
"use strict";
function Parsimmon(action) {
if (!(this instanceof Parsimmon)) {
return new Parsimmon(action);
}
this._ = action;
}
var _ = Parsimmon.prototype;
function Rule(name, symbols, postprocess) {
this.id = ++Rule.highestId;
this.name = name;
this.symbols = symbols; // a list of literal | regex class | nonterminal
this.postprocess = postprocess;
return this;
}
Rule.highestId = 0;
@iomeone
iomeone / BinarySearch.h
Created November 5, 2019 14:36 — forked from adamski/BinarySearch.h
Binary Search functions for JUCE ValueTree and Array types
/*
==============================================================================
BinarySearch.h
Created: 31 Jul 2014 9:57:04am
Author: Adam Wilson
==============================================================================
*/
@iomeone
iomeone / CustomCallOutBox.cpp
Created November 5, 2019 23:31 — forked from adamski/CustomCallOutBox.cpp
Custom class derived from CallOutBox for removing arrow (JUCE)
#include "CustomCallOutBox.h"
CustomCallOutBox::CustomCallOutBox (Component &contentComponent,
const Rectangle< int > &areaToPointTo,
Component *parentComponent,
bool drawArrow)
: CallOutBox (contentComponent, areaToPointTo, parentComponent), drawArrow (drawArrow)
{
@iomeone
iomeone / msdf.glsl
Created November 19, 2019 09:22 — forked from ruby0x1/msdf.glsl
simple MSDF shader
float r = sample.r;
float g = sample.g;
float b = sample.b;
float median = max(min(r, g), min(max(r, g), b));
float signed_dist = median - 0.5;
float d = fwidth(signed_dist);
float opacity = smoothstep(-d, d, signed_dist);
//apply opacity to final alpha
color.a *= opacity;
@iomeone
iomeone / app.py
Last active March 13, 2020 03:58 — forked from liulixiang1988/app.py
upload multiple files in Flask
import os
# We'll render HTML templates and access data sent by POST
# using the request object from flask. Redirect and url_for
# will be used to redirect the user once the upload is done
# and send_from_directory will help us to send/show on the
# browser the file that the user just uploaded
from flask import Flask, render_template, request, redirect, url_for, send_from_directory
from werkzeug import secure_filename
# Initialize the Flask application
/*
* Module Name:
* WorkingSetWatch.cpp
*
* Abstract:
* Tracks page faults that occur within the process.
*
* NOTE: This is not compatible with Wow64 and must be run as a 64-bit
* program on x64 and a 32-bit program on x86.
*
@iomeone
iomeone / x86-assembly-notes.md
Created November 28, 2020 04:02 — forked from mikesmullin/x86-assembly-notes.md
Notes on x86-64 Assembly and Machine Code

Mike's x86-64 Assembly (ASM) Notes

Assembling Binary Machine Code

Operating Modes:

These determine the assumed/default size of instruction operands, and restricts which opcodes are available, and how they are used.

Modern operating systems, booted inside Real mode,

#define _CRT_SECURE_NO_WARNINGS
#include <string.h>
#include <stdio.h>
#include <windows.h>
#pragma warning (disable: 4146)
#include <stdint.h>
#ifdef _DEBUG
#define Assert(x) \
if (!(x)) { MessageBoxA(0, #x, "Assertion Failure", MB_OK); __debugbreak(); }