Skip to content

Instantly share code, notes, and snippets.

View anataliocs's full-sized avatar

Chris Anatalio anataliocs

View GitHub Profile

Mermaid on Github Examples

All of these diagrams are dynamically rendered during html display by Github, the images generated from text inside the Github-Flavored Markdown. None are static images. Mermaid support was released for Github on 2022-02-14

Pros & Cons:

  • Pro: You don't need to care about the layout.
  • Con: You cannot control the layout.

Notes:

  • Not all the features of Mermaid (in particular symbols B-->C[fa:fa-ban forbidden], hyperlink and tooltips) are supported by Github.
@anataliocs
anataliocs / eventsource.js
Created May 7, 2025 11:05 — forked from mattpodwysocki/eventsource.js
Adding support for server-sent events for RxJS
if (!!root.EventSource) {
/**
* This method wraps an EventSource as an observable sequence.
* @param {String} url The url of the server-side script.
* @param {Observer} [openObserver] An optional observer for the 'open' event for the server side event.
* @returns {Observable} An observable sequence which represents the data from a server-side event.
*/
dom.fromEventSource = function (url, openObserver) {
return new AnonymousObservable(function (observer) {
use std::ffi::{OsStr, OsString};
let as_ref1: OsString = OsString::from(OsString::from("stellar contract build"));
assert_eq!("stellar contract build", as_ref1);
@anataliocs
anataliocs / list-of-curl-options.txt
Created July 18, 2024 17:58 — forked from eneko/list-of-curl-options.txt
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@anataliocs
anataliocs / minmax.rs
Created June 16, 2024 04:07
Rust minmax function with array manipulation
fn miniMaxSum(arr: &[i32]) {
let len = arr.len();
let mut list: Vec<i64> = vec![];
for n in 0..len {
let &sum = &arr.iter()
.enumerate()
.filter(|(index, &y)| !index.eq(&n))
.map(|(i, &y)| i64::from(y))
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract Primitives {
bool public boo = true;
/*
uint stands for unsigned integer, meaning non negative integers
different sizes are available
uint8 ranges from 0 to 2 ** 8 - 1
gid:S8rNiPpqbqjzkYrsk6yH7f
@anataliocs
anataliocs / truffle-config.js
Created May 2, 2022 20:54
truffle-config.js
const path = require("path");
const HDWalletProvider = require("@truffle/hdwallet-provider");
const mnemonic = "";
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {