Skip to content

Instantly share code, notes, and snippets.

View FreeMasen's full-sized avatar

Robert Masen FreeMasen

View GitHub Profile
@FreeMasen
FreeMasen / sub.ll
Last active October 13, 2023 20:29
; ModuleID = 'std::tvalue'
source_filename = "std::tvalue"
%"std::tvalue::TValue" = type { i8, [23 x i8] }
%"std::tvalue::TValue::Number" = type { [12 x i8], float }
define void @"std::tvalue::new_num"(ptr sret(%"std::tvalue::TValue") %0, float %1) {
entry:
%tag_ptr = getelementptr inbounds %"std::tvalue::TValue", ptr %0, i32 0, i32 0
store i8 2, ptr %tag_ptr, align 1
@FreeMasen
FreeMasen / early_example.ll
Created October 1, 2023 00:57
early example
; ModuleID = 'early_example'
source_filename = "early_example"
%"std::tvalue::TValue" = type { i8, [23 x i8] }
%"std::tvalue::TValue::Bool" = type { [23 x i8], i8 }
%"std::tvalue::TValue::Number" = type { [12 x i8], float }
%"std::tvalue::TValue::String" = type { i8, i32, i32, i32, ptr }
@"tvalue::names::nil" = global [5 x i8] c"nil\0A\00"
@"tvalue::names::true" = global [6 x i8] c"true\0A\00"
@FreeMasen
FreeMasen / add.ll
Created September 30, 2023 00:30
add test ir for luminary compiler
; ModuleID = 'std::tvalue'
source_filename = "std::tvalue"
%"std::tvalue::TValue" = type { i8, [23 x i8] }
%"std::tvalue::TValue::Bool" = type { [23 x i8], i8 }
%"std::tvalue::TValue::Number" = type { [12 x i8], float }
%"std::tvalue::TValue::String" = type { i8, i32, i32, i32, ptr }
@"tvalue::names::nil" = global [5 x i8] c"nil\0A\00"
@"tvalue::names::true" = global [6 x i8] c"true\0A\00"
local cosock = require "cosock"
local tx1, rx1 = cosock.channel.new()
local tx2, rx2 = cosock.channel.new()
cosock.spawn(function()
print('1 started')
assert(rx2:receive())
print('1 exiting')
tx1:send(1)
end)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
pub fn is_valid2(code: &str) -> bool {
code.chars().filter(|&c| c != ' ').count() > 1
&& code.chars().filter(|&c| c != ' ').all(|c| c.is_digit(10))
&& code
.chars()
.filter(|&c| c != ' ')
.rev()
.enumerate()
.fold(0, |acc, (i, c)| match (i, c.to_digit(10).unwrap()) {
(i, d) if i % 2 == 0 => acc + d,
INSERT INTO user (name, email) VALUES
('Janette Hewey', 'Janette.Hewey@example.com'),
('Leonor Hoffert', 'Leonor.Hoffert@example.com'),
('Deidra Funke', 'Deidra.Funke@example.com'),
('Shannon Lamkin', 'Shannon.Lamkin@example.com'),
('Donn Vidrine', 'Donn.Vidrine@example.com'),
('Georgene Urbanek', 'Georgene.Urbanek@example.com'),
('Kaleigh Arndt', 'Kaleigh.Arndt@example.com'),
('Alyssa Trudeau', 'Alyssa.Trudeau@example.com'),
('Lashaun Zielke', 'Lashaun.Zielke@example.com'),

Keybase proof

I hereby claim:

  • I am freemasen on github.
  • I am freemasen (https://keybase.io/freemasen) on keybase.
  • I have a public key ASAFdCd8RMpKhGs27Bbta7ZkM56yAAUBb7eLhhRkQNYl9go

To claim this, I am signing this object:

fn slice_to_uint9_array(slice: &[u8]) -> UInt8Array {
let mut ret = UInt8Array::new_with_length(slice.len());
for (i, x) in slice.iter().enumerate() {
ret.set(i, x);
}
ret
}
@FreeMasen
FreeMasen / ast.json
Created May 21, 2019 18:55
JS AST Example
{
"type": "Program",
"body": [
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": ">",
"left": {
"type": "CallExpression",