Skip to content

Instantly share code, notes, and snippets.

View ManUtopiK's full-sized avatar
:octocat:
Ready to code.

Emmanuel Salomon ManUtopiK

:octocat:
Ready to code.
View GitHub Profile
const Stack = require("./stack.js")
class Operation {
constructor(val) {
this.value = val
}
}
class Add extends Operation {
class Queue {
data = []
maxSize
constructor(initialData, maxSize = -1) {
this.data = Array.isArray(initialData) ? initialData : (typeof initialData == "undefined" ? [] : [initialData])
this.maxSize = maxSize
}
isFull() {
@Glutnix
Glutnix / _slug.vue
Created July 15, 2020 06:47
nuxt + nuxt-composition-api + typescript + @nuxt/content
<template>
<div>
nuxt.js + nuxt-composition-api + typescript + @nuxt/content to work with meta generated by $content in setup,
and have it generate the appropriate tags at generation time!
<journal-post v-if="journal" :post="journal" />
</div>
</template>
<script lang="ts">
import {
@rponte
rponte / taskqueues.sql
Created April 26, 2020 00:40 — forked from purcell/taskqueues.sql
Easy task queues using PostgreSQL
-- Let's say you have a table full of work:
CREATE TABLE tasks (
id UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(),
status TEXT NOT NULL DEFAULT 'pending',
payload JSON NOT NULL, -- or just have meaningful columns!
created_at TIMESTAMP NOT NULL DEFAULT NOW()
);
@GavinRay97
GavinRay97 / index.md
Last active April 12, 2024 18:31
Hasura organization permissions

Introduction

This document outlines how to model a common organization-based permission system in Hasura. Let's assume that you have some table structure like the following:

Table Name Columns Foreign Keys
User id, name, email
Organization User id, user_id, organization_id user_id -> user.id, organization_id -> organization.id
Organization id, name
var express = require('express');
var app = express();
...
//in your server.js (or routes file), include the following above your api routes and the main route that hands users your index.html file
nonSPArouter = express.Router();
//in a general route, you check all incoming traffic for your preferred crawlers through the user-agent
app.use(function(req,res,next) {
var ua = req.headers['user-agent'];
if (/^(facebookexternalhit|twitterbot)/gi.test(ua)) {
nonSPArouter(req,res,next);

When you register for Pseudonym Pairs, you use register(). You need a “registrationToken” that you got if you were verified in the last event. You can see one be deducted from your account with registrationToken[msg.sender]--. The purpose of the registration tokens is that you can easily mix them, so that your personhood is not traceable from month to month. Why? Why not, it gives everyone a new chance in life every month, prejudice becomes impossible, discrimination also impossible, etc. There is no advantage in associating personal data to these personhoods, since “who you are “ does not have to be defined for the verification procedure, and there are many advantages with the anonymity. For example, you now live in a world of totalitarian surveillance, wouldn’t it be good if you at the same time could enjoy some integrity? Pseudonym Pairs solves that. Good.

function register() public scheduler {

require(d[l()].registry[msg.sender].id == 0 && d[l()-1].mi

@tomhicks
tomhicks / plink-plonk.js
Last active October 15, 2025 13:41
Listen to your web pages
@diegopacheco
diegopacheco / actix_netty_vs_fastify.md
Last active July 28, 2023 19:33
Actix(Rust) VS Netty(Java) VS Fastify(Nodejs)

Fastify did 6K RPS (Request per Second)
Netty did 23K RPS (Request Per Second)
Actix did 53K RPS (Request Per Second)

Actix 1ms latency
Netty 4ms latency
Fastify 14ms latency

npm install -g autocannon
@Akryum
Akryum / List.vue
Created December 15, 2019 14:40
Vue - onScrollBottom composable function
<script>
import { ref } from '@vue/composition-api'
import { onScrollBottom } from '@/scroll'
export default {
setup () {
function loadMore () {
// ...
}