Skip to content

Instantly share code, notes, and snippets.

View kavichu's full-sized avatar
🎯
Focusing

Luis Valdés kavichu

🎯
Focusing
View GitHub Profile
@kavichu
kavichu / jmeter.sh
Created January 20, 2024 16:49
jmeter
jmeter -n -t /app/benchmark.jmx \
-l /app/jmeter.log \
-Jhost=magento.aminovate.com \
-Jrequest_protocol=https \
-Jadmin_password=Urubu#2024#7e43d4daee7e \
-Jbase_path=/ \
-JfrontendPoolUsers=50 \
-JaddToCartByGuestPercentage=80 \
-JaddToCartByCustomerPercentage=20 \
-JadminPoolUsers=50 \
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreia6bzlwxi6a3iny5wsi5sh5oajxqw5jqsdm455m6bxlzcdtltxetu ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@kavichu
kavichu / .deps...npm...@openzeppelin...contracts...security...ReentrancyGuard.sol
Created August 28, 2021 17:11
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
@kavichu
kavichu / Cargo.toml
Last active February 9, 2021 19:28
Ownership in Rust
[package]
name = "cli-0"
version = "0.1.0"
authors = ["Luis Valdes <valdesis@amazon.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
structopt = "0.3.13"
@kavichu
kavichu / env_file.sh
Created September 3, 2019 01:52
Env File
#!/bin/zsh
export CLICOLOR=1
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
export GOROOT=/usr/local/go
export PATH=$GOROOT/bin:$PATH
export GOPATH=/Users/kavichu/workspace/go-workspace
@kavichu
kavichu / nginx-https.md
Created March 13, 2018 16:57
Redirect HTTP to HTTPS Nginx
server {
	listen 80 default_server;
	listen [::]:80 default_server;
	server_name _;
	return 301 https://$host$request_uri;
}

or

@kavichu
kavichu / flatten_array.exs
Created April 21, 2017 16:47
Elixir noob code to flatten array
defmodule Citrusbyte do
def flatten([head | tail]) do
if(is_list(head)) do
flatten(head) ++ flatten(tail)
else
[head] ++ flatten(tail)
end
end
def flatten([]) do
[]
@kavichu
kavichu / triple_o_summary.md
Created April 17, 2017 23:19
OpenStack Triple O Troubleshooting - Installing openstack-tripleo-ui from rdo-trunk-newton-tested

Running the quickstart script

bash quickstart.sh $VIRTHOST

Get the IP of the undercloud VM

TASK [setup/undercloud : Get undercloud vm ip address] *************************
task path: /home/ansible/.quickstart/tripleo-quickstart/roles/libvirt/setup/undercloud/tasks/main.yml:295
Monday 17 April 2017 18:04:07 +0000 (0:00:02.322) 0:11:31.488 ********** 
@kavichu
kavichu / flatten_array.js
Created April 16, 2017 19:18
ES6 code to flatten array of arbitrarily nested arrays
let arr = [[1,2,[3]],4];
let flatten = (accu, e) => {
if(!Array.isArray(e)){
return [...accu, e];
}else{
return [...accu, ...e.reduce(flatten, [])];
}
}