Skip to content

Instantly share code, notes, and snippets.

View nasser's full-sized avatar
🛰️
save-lisp-and-die

Ramsey Nasser nasser

🛰️
save-lisp-and-die
View GitHub Profile
@nasser
nasser / clr-types.md
Created November 2, 2018 15:42
Primitive Type Names on the CLR

Primitive types on the Common Language Runtime have different names depending on who you ask

  • CIL names used in Common Intermediate Language bytecode instructions like ldc.* and conv.*
  • CTS names used in the Common Type System that underlies languages running on the CLR
  • .NET names used in the .NET framework. These are the names of the classes that correspond to the primitive types, and will show up in stack traces and reflection.
  • C# names used in C# syntax
  • F# names used in F# syntax

| CIL | CTS | .NET | C# | F# |

using clojure.lang;
using clojure.lang.Runtime;
using clojure.lang.Runtime.Binding;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
@nasser
nasser / tent.js
Created October 15, 2018 18:15
minimal janky port of entt to js
function ComponentSet() {
this.entities = [];
this.indices = []; // could be a hashmap
this.components = [];
this.size = 0;
}
ComponentSet.prototype.insert = function (entity, component) {
this.entities.push(entity);
this.components.push(component);
public static void Circle(int x0, int y0, int radius, uint c)
{
int x = radius;
int y = 0;
int dx = 1;
int dy = 1;
int err = dx - (radius << 1);
while (x >= y)
{
// https://github.com/tgsstdio/OpenTK-Demos/blob/master/ComputeDemo/Demo.cs
using System;
using OpenTK.Graphics.OpenGL;
using OpenTK;
using OpenTK.Graphics;
namespace Pico
{
public class Demo
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <glib.h>
#include <mono/metadata/image.h>
#include <mono/metadata/verify.h>
#include <mono/metadata/class.h>
#include <mono/metadata/loader.h>
#include <mono/metadata/object.h>
// based on https://gist.github.com/nrdobie/8193350
#include <SPI.h>
#define LOAD_PIN 7
void setup() {
// Set load pin to output
pinMode(LOAD_PIN, OUTPUT);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nasser
nasser / serial.js
Created April 25, 2018 03:34
hardware serial round trip
var SerialPort = require('serialport');
var port = new SerialPort('/dev/cu.usbmodem1411', {
baudRate: 9600
});
port.on('open', function() {
console.log("serial port connected")
});
@nasser
nasser / hardware.svg
Created April 25, 2018 03:31
hardware
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.