Skip to content

Instantly share code, notes, and snippets.

View quin2's full-sized avatar

Quinn Vinlove quin2

View GitHub Profile
@quin2
quin2 / index.ts
Created February 22, 2024 16:48
html/react native parser in typescript
const input2 = '"<View><ExpoStatusBar style=\"{ \"flex\": 1}\" yeet="yaw"></ExpoStatusBar></View>"'
class Attrib {
name: string;
val: string;
constructor(name: string, val: string){
this.name = name
this.val = val
}
package main
import (
"context"
"crypto/rand"
"encoding/json"
"fmt"
firecracker "github.com/firecracker-microvm/firecracker-go-sdk"
models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
"io"
#simple firecracker hello world with networking
set -eu
[ -e hello-vmlinux.bin ] || wget https://s3.amazonaws.com/spec.ccfc.min/img/hello/kernel/hello-vmlinux.bin
[ -e hello-rootfs.ext4 ] || wget -O hello-rootfs.ext4 https://raw.githubusercontent.com/firecracker-microvm/firecracker-demo/ec271b1e5ffc55bd0bf0632d5260e96ed54b5c0c/xenial.rootfs.ext4
[ -e hello-id_rsa ] || wget -O hello-id_rsa https://raw.githubusercontent.com/firecracker-microvm/firecracker-demo/ec271b1e5ffc55bd0bf0632d5260e96ed54b5c0c/xenial.rootfs.id_rsa
TAP_DEV="fc-88-tap0"
@quin2
quin2 / ranking.sol
Last active March 14, 2021 04:06
ranking
pragma solidity >=0.7.0 <0.8.0;
contract rankingApp
{
uint256 nThings;
address private owner;
mapping (string => uint256) public things;
mapping (uint256 => uint256) public ratings;
constructor() {
@quin2
quin2 / key-finder.json
Last active November 15, 2020 07:03
Get API Gateway Key inside Cloudformation, with JSON and Python 3 (Place objects under "Resources" parent)
"LambdaApiGatewayRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [{ "Effect": "Allow", "Principal": {"Service": ["lambda.amazonaws.com"]}, "Action": ["sts:AssumeRole"] }]
},
"Path": "/",
"Policies": [
{
@quin2
quin2 / EditableListWidget.py
Created July 27, 2020 21:23
MacOS style editable ListWidget for PyQt5
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QPushButton
from PyQt5.QtCore import Qt
class EditableListWidget(QWidget):
def __init__(self, parent):
super(QWidget, self).__init__(parent)
self.layout = QVBoxLayout()
self.listWidget = QListWidget()
@quin2
quin2 / update.sh
Created October 17, 2019 16:12
goes with deploy.sh
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Usage: enter one argment for the static site/bucket name"
exit 0
fi
aws s3 sync --acl public-read --sse --delete . s3://$1
@quin2
quin2 / deploy.sh
Created October 17, 2019 16:11
script to make current directory into a public, static website on aws. requires aws api that's setup and ready to go
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Usage: enter one argment for the static site/bucket name"
exit 0
fi
aws s3 mb s3://$1
aws s3 website s3://$1 --index-document index.html --error-document error.htm
@quin2
quin2 / tinyminer.c
Created May 7, 2019 06:59
Proof-of-concept cryptocurrency miner written in C
//implements a basic proof-of-work system in C. Code by quin2
/*
note: mining in this case is pretty easy beacuse our hash algo isn't computationally intensive, plus we're not
encoding a whole lot of data
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@quin2
quin2 / index.html
Created June 20, 2017 20:23
Portfolio Page
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<nav class="navbar turnBlue navbar-fixed-top">
<div class="container">
<ul class="nav navbar-nav">
<li><a href="#WORK">progress</a></li>
<li><a href="#DONE">complete</a></li>
<li><a href="#SOCIAL">social</a></li>
</ul>
</div>