Skip to content

Instantly share code, notes, and snippets.

View soltrinox's full-sized avatar
🤖
Building Cybernetic Systems

Mr. Rosario soltrinox

🤖
Building Cybernetic Systems
View GitHub Profile
CACHE GIT CREDENTIALS ON UNIX
git config --global credential.helper cache
git config --global credential.helper "cache --timeout=360000"
ON OSX
git config --global credential.helper osxkeychain
git config --global credential.helper "cache --timeout=360000"
@diegopacheco
diegopacheco / pyaudio-ubuntu-install.md
Last active June 20, 2024 20:49
How to Install pyaudio ubuntu 16.04 LTS?
sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0
sudo apt-get install ffmpeg libav-tools
sudo pip install pyaudio
@nandorojo
nandorojo / use-swr-infinite-enhanced.ts
Last active July 10, 2023 11:01
useSWRInfinite with pagination & typescript safety
import { ConfigInterface, useSWRInfinite } from 'swr'
import { useMemo, useCallback, useRef } from 'react'
import last from 'lodash.last'
import get from 'lodash.get'
type PageKeyMaker<Page, Key extends any[]> = (
index: number,
previousPageData?: Page
/**
* Mutable ref object. Set this to `true` before the request and `false` afterwards if the request is fetching more.
@soltrinox
soltrinox / gist:7ec1184d10d1a0867fb489377e2ab665
Last active March 26, 2021 22:01
BOUNDARY / CONSEQUENCE VIOLATION PROTOCOL >> A-Z STEPS
HOW TO DO BOUNDARIES RIGHT IN YOUR LIFE: 
[ PSYCHOLOGICAL DEFENSE SERIES ] TITLE: Establishment of  CONSCIOUS violation vs. UNCONSCIOUS violation of BOUNDARIES and the protocol for delivery of CONSEQUENCE due to BOUNDARY VIOLATION.
 
[DANGER DO NOT READ THIS PROTOCOL IF YOU HAVE INSECURITIES AND OR ARE OPERATING WITH PATHOLOGICAL INTENT ]
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! THIS IS A RAW PSYCH SELF-DEFENSE SYSTEM ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
[DANGER DO NOT READ THIS PROTOCOL IF YOU HAVE INSECURITIES AND OR ARE OPERATING WITH PATHOLOGICAL INTENT ]
-------------------
@soltrinox
soltrinox / BOUNDARIES.txt
Last active March 31, 2022 08:41
HOW TO DO BOUNDARIES RIGHT IN YOUR LIFE
`
HOW TO DO BOUNDARIES RIGHT IN YOUR LIFE:
[ PSYCHOLOGICAL DEFENSE SERIES ] TITLE: Establishment of CONSCIOUS violation vs. UNCONSCIOUS violation of BOUNDARIES and the protocol for delivery of CONSEQUENCE due to BOUNDARY VIOLATION.
[DANGER DO NOT READ THIS PROTOCOL IF YOU HAVE INSECURITIES AND OR ARE OPERATING WITH PATHOLOGICAL INTENT ]
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! THIS IS A RAW PSYCH SELF-DEFENSE SYSTEM ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
[DANGER DO NOT READ THIS PROTOCOL IF YOU HAVE INSECURITIES AND OR ARE OPERATING WITH PATHOLOGICAL INTENT ]
@liweitianux
liweitianux / nginx.google.conf
Created July 17, 2021 03:44
Nginx Proxy to Google
#
# Nginx reverse proxy to Google Search (with images and webcache))
#
# Credit:
# * Nginx rewrite append a parameter at the end of an URL
# https://serverfault.com/a/311660/387898
# * https://github.com/tracycool/Reverse-Proxy-for-Google
# * https://github.com/caiguanhao/nginx-bypass-gfw/blob/master/google.conf
#
# References:
@otmb
otmb / ContentView.swift
Last active April 18, 2024 18:37
WKWebView can read a wasm from a localfile with XMLHttpRequest, but returns an error with fetch
import SwiftUI
import WebKit
enum WebViewError: Error {
case contentConversion(String)
case emptyFileName
case inivalidFilePath
var message: String {
switch self {
from algoliasearch import algoliasearch
import pymongo
from pymongo import MongoClient
import json
client = algoliasearch.Client("Your_Application_ID", 'Your_API_Key')
index = client.init_index('Experiment_1')
MONGODB_URL1 = 'Your_MongoDB_Connection_String'
def move_collection(from_collection):
@soltrinox
soltrinox / insttruct-nginx-wss-rev-proxy.md
Created February 11, 2023 16:26
Nginx - Reverse proxy for HTTPS and WSS - Self Signed Certificates and Trusted Certificates

How to use Nginx as a Reverse proxy for HTTPS and WSS - Self Signed Certificates and Trusted Certificates

FrdS > credit...

Introduction

Nginx is a web server, also works as a load balancer, and may help us a lot in security and routing terms, because when deploying our applications to a production environment, we don’t want to put ports on the url, and also the dns has to look like clean to our users, also for security reasons, we don’t want to show the port explicitly where the service is being run. Also, I decided to make this tutorial, because I was working on a cryptocurrency exchange platform in a freelancing job, and the frontend communicates with the relayer(backend that receives the user order's for exchanging Tokens/Crypto) by HTTPS and WSS. The HTTP it was for the general APIs and for posting new buy/sell orders, and the Websockets was for making a full-duplex communication for near realtime u

const β = require('bignumber.js');
function Ω(a, m) {
const b = new β(a).mod(m);
for (let x = new β(1); x.lt(m); x = x.plus(1)) {
if (b.times(x).mod(m).eq(1)) {
return x;
}
}
return new β(1);