Skip to content

Instantly share code, notes, and snippets.

View anataliocs's full-sized avatar

Chris Anatalio anataliocs

View GitHub Profile
@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))
@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
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 / 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) {

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--&gt;C[fa:fa-ban forbidden], hyperlink and tooltips) are supported by Github.
@anataliocs
anataliocs / git.md
Last active May 14, 2025 06:28
Stellar Toronto Builder Summit—EasyA Consensus Hackathon 2025 Helpful Scripts

Reset Repo and Re-choose front-end framework

Reset vanillajs and

git add . && git stash && rm -rf node_modules && rm -rf snapchain-vanillajs/target

Reset astro