Skip to content

Instantly share code, notes, and snippets.

View infu's full-sized avatar
⚒️
nftanvil, icp, ftw!

infu

⚒️
nftanvil, icp, ftw!
View GitHub Profile
@infu
infu / oc_user.did
Created April 5, 2023 08:42
OC user did
type AccessorId = principal;
type AccountIdentifier = blob;
type BlockIndex = nat64;
type CanisterId = principal;
type ChatId = CanisterId;
type Cycles = nat;
type EventIndex = nat32;
type FileId = nat;
type Hash = blob;
type ICP = Tokens;
type AccessorId = principal;
type AccountIdentifier = blob;
type BlockIndex = nat64;
type CanisterId = principal;
type ChatId = CanisterId;
type Cycles = nat;
type EventIndex = nat32;
type FileId = nat;
type Hash = blob;
type ICP = Tokens;
@infu
infu / gist:ba6d9ecaba50ea29c2f5b506a1e3e945
Created October 23, 2022 13:29
Service Worker change
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8" />
<title>Internet Computer Content Validation Bootstrap</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<style>
html,
body {
@infu
infu / gist:8a015965bbc882fa6ecdc204d8dbdb8f
Created September 10, 2022 10:15
Attempt to implement ReactiveX in Motoko with "chaining"
module {
public type Operator<X,Y> = (Observable<X>) -> (Observable<Y>);
public func map<X,Y>( fn: (X) -> (Y) ) : (Observable<X>) -> (Observable<Y>) {
return func ( x : Observable<X> ) {
Observable<Y>( func (subscriber) {
x.subscribe({
next = func(v) {
@infu
infu / gist:ec29a89de63308378a33bbf6dc64a884
Created July 1, 2022 13:21
Anvil - Glue integration proposal
Variant 1)
@challenge_data has inside {@role, @guild_id, custom_matching_patterns (this will allow matching like strenght > 10 or has_tag, glue doesn't care about it, for glue its just a blob)}
1) User clicks a link leading to Glue
2) User uses "Log In With Discord" (glue backend now has: @guild_id, @user_id, @challenge_data)
3) User clicks "Connect with Anvil" or "Prove with Anvil" and gets sent to https://nftanvil.com (anvil frontend now has: @return_url, @challenge_data)
4) User selects an NFT and then clicks "Prove".
5) Anvil's smart contracts parse the @challenge_data and verify if it matches
6) A transaction is generated with @memo (32byte hash of @challenge_data)
Call failed:
Canister: ryjl3-tyaaa-aaaaa-aaaba-cai
Method: test (query)
"Status": "rejected"
"Code": "CanisterError"
"Message": "IC0503: Canister ryjl3-tyaaa-aaaaa-aaaba-cai trapped explicitly: Panicked at 'called `Result::unwrap()` on an `Err` value: Object(JsObject(GcCell { value: Object { data: ObjectData { kind: Error, internal_methods: \"internal_methods\" }, properties: PropertyMap { indexed_properties: {}, string_properties: OrderedHashMap({\"message\": PropertyDescriptor { enumerable: Some(false), configurable: Some(true), kind: Data { value: Some(String(\"bucketSize is not initialized\")), writable: Some(true) } }}), symbol_properties: OrderedHashMap({}) }, prototype: Some(JsObject(GcCell { value: Object { data: ObjectData { kind: Ordinary, internal_methods: \"internal_methods\" }, properties: PropertyMap { indexed_properties: {}, string_properties: OrderedHashMap({\"name\": PropertyDescriptor { enumerable: Some(false), configurable: Some(true), kind: Data { value: Some(String(\"ReferenceError\")), w
https://www.aliexpress.com/item/32967057436.html
https://www.aliexpress.com/item/32815934251.html 24V 1PC
https://www.aliexpress.com/item/32968950322.html
https://www.aliexpress.com/item/32916210903.html
https://www.aliexpress.com/item/32816041972.html
https://www.aliexpress.com/item/32853548000.html 1PC 1.75MM M7
https://www.aliexpress.com/item/32993360291.html 0.4MM 1.75 1pc
@infu
infu / gist:03eda9cdd2bd77915f5cab4f39f668ef
Created February 2, 2018 13:42
available php modules
php7.0-bcmath - Bcmath module for PHP
php7.0-bz2 - bzip2 module for PHP
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-common - documentation, examples and common module for PHP
php7.0-curl - CURL module for PHP
php7.0-dba - DBA module for PHP
php7.0-dev - Files for PHP7.0 module development
php7.0-enchant - Enchant module for PHP
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
### Keybase proof
I hereby claim:
* I am infu on github.
* I am infu (https://keybase.io/infu) on keybase.
* I have a public key ASBsDbBdUOwqBg2AAeN4M5nnkbAoE7WYxSMJeR9mUkOtjwo
To claim this, I am signing this object: