Skip to content

Instantly share code, notes, and snippets.

View cesarvargas00's full-sized avatar
🌟
Focusing

César Vargas cesarvargas00

🌟
Focusing
View GitHub Profile
@cesarvargas00
cesarvargas00 / question.js
Created July 16, 2021 19:41
twitter question
function empirical(x, y, n){
for (let i = 0; i < n; i++){
x = x * (1 + (Math.random() < .5 ? -1 : 1) * (Math.random() * y)/x)
}
return x
}
let xs = []
for (let i = 0; i < 10000; i++){
@cesarvargas00
cesarvargas00 / bs.ipynb
Last active March 20, 2023 21:09
black and scholes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
mdY5gcRkHAUDoT1ozxte3I0HPcsZoTbPN6HL7uxY0tCF8VvCmO76Afmtdkjt9Q9coypBPO3NMcbjLvk02WHsDg==--pUM5MMiEkb7IDrtbgZ+FuQ==--OCPpMBlU8nZvEJ2QbGoUFQ==
@cesarvargas00
cesarvargas00 / markowitz.js
Last active November 3, 2020 23:08
markowitz.js
function correlation(x, y) {
if (x.length !== y.length) return null
const xMean = x.reduce((acc, el) => el + acc, 0) / x.length
const yMean = y.reduce((acc, el) => el + acc, 0) / y.length
let numerator = 0,
xDSquaredSum = 0,
yDSquaredSum = 0
@cesarvargas00
cesarvargas00 / ubuntu_razer15_2019.sh
Last active February 17, 2020 02:36
Fixes Razer Blade Infinite Loop and Hibernation Stall
echo 'blacklist ucsi_ccg' | sudo tee -a /etc/modprobe.d/blacklist.conf #hibernation stall fix. Might have to remove l8r.
sudo sed 's/quiet splash/quiet splash button.lid_init_state=open /g' /etc/default/grub | sudo tee /etc/default/grub #wake up loop fix
sudo update-grub #save kernel params to grub
echo 'razer blade configurado...'
unbindall
bind "0" "slot10"
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"
bind "5" "slot5"
bind "6" "slot6"
bind "8" "slot8"
bind "9" "slot9"
{
"name": "Questionário Geral Público",
"creation": "2018-11-15T20:04:33.787Z",
"resources": {
"money": {
"name": "dinheiro",
"subrecursos": {
"organizacao": {
"name": "organização",
"toAvoid": [
@cesarvargas00
cesarvargas00 / gauss.py
Last active October 6, 2018 01:47
Implementação do método de Gauss em python
# ALUNO: Cesar Vargas
# TIA: 30908639
import copy
# Exercício 1
def triangular(entrada):
saida = [None for x in range(len(entrada))]
for i in reversed(range(0,len(entrada[0])-1)): #for (int i=sizeof(entrada)/sizeof(entrada[0]); i > 0; i--)
soma = 0
@cesarvargas00
cesarvargas00 / new-computer.sh
Created June 2, 2017 00:17
New computer bash script
#installs homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#install zshell
brew install zsh pyenv
sudo dscl . -create /Users/$USER UserShell /usr/local/bin/zsh
#install some apps
brew cask install flycut spectacle google-chrome spotify skype slack sublime-text