Skip to content

Instantly share code, notes, and snippets.

View joaquimnetocel's full-sized avatar

Joaquim Henriques joaquimnetocel

View GitHub Profile
// store.ts
import { getContext, setContext } from 'svelte';
import { writable, type Writable } from 'svelte/store';
export function createStore() {
const mystore = writable('INITIAL VALUE');
setContext('contextStore', mystore);
}
export function readStore() {
@joaquimnetocel
joaquimnetocel / runify.js
Created October 27, 2023 01:21 — forked from jherr/runify.js
runify.js
export function runify(obj) {
if(Array.isArray(obj)) {
return obj.map(runify);
} else if(typeof obj === 'object') {
let rune = $state(obj);
let output = {};
for(let key in rune) {
if(typeof obj[key] === 'object') {
obj[key] = runify(obj[key]);
}
@joaquimnetocel
joaquimnetocel / node-linux.md
Created March 16, 2024 02:20
INSTALAÇÃO DO NODE NO LINUX
sudo apt update
sudo apt upgrade
sudo apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install nodejs -y
node --version.

NO CASO DE ERRO, TENTAR:

@joaquimnetocel
joaquimnetocel / speed-test.js
Last active March 16, 2024 02:22
JAVASCRIPT SPEED TEST
const numberStartTime = new Date().getTime();
const functionCalculateSolution = function (argA, argB, argC) {
const numberDelta = argB * argB - 4 * argA * argC;
const numberSolution1 = (-argB + Math.sqrt(numberDelta)) / (2 * argA);
const numberSolution2 = (-argB - Math.sqrt(numberDelta)) / (2 * argA);
return [numberSolution1, numberSolution2];
};
for (let i = 0; i < 200000000; i++) {
@joaquimnetocel
joaquimnetocel / github-icons.md
Last active March 16, 2024 02:23
CÓDIGOS DE EMOTICONS PARA USAR NO GITHUB

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@joaquimnetocel
joaquimnetocel / speed-test.r
Last active March 16, 2024 02:24
R SPEED TEST
numberStartTime = Sys.time()
functionCalculateRoots = function(argA, argB, argC){
numberDelta = argB^2 - 4*argA*argC
numberFirstRoot = (-argB + sqrt(numberDelta))/2*argA
numberSecondRoot = (-argB -sqrt(numberDelta))/2*argA
return (c(numberFirstRoot,numberSecondRoot))
}
for (i in 1:200000000){
@joaquimnetocel
joaquimnetocel / git-config.md
Created March 16, 2024 02:27
GIT ACCOUNT CONFIG
git config --global user.name "TYPE YOUR NAME HERE"
git config --global user.email your_email_in_github@provider.com
@joaquimnetocel
joaquimnetocel / python-remove-all-packages.md
Created March 16, 2024 02:30
REMOVE ALL PYTHON PACKAGES
pip freeze > requirements.txt  
pip uninstall -r requirements.txt -y
@joaquimnetocel
joaquimnetocel / linux-python-installation.md
Created March 16, 2024 02:33
INSTALL PYTHON ON LINUX
sudo apt install python-is-python3
sudo apt install python3-pip
sudo apt install python3.10-venv
@joaquimnetocel
joaquimnetocel / linux-snap-update.md
Created March 16, 2024 02:34
UPDATE SNAP STORE ON LINUX
sudo killall snap-store
sudo snap refresh
``