Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Luis Valdés kavichu

🎯
Focusing
View GitHub Profile
@kavichu
kavichu / Cargo.toml
Last active Feb 9, 2021
Ownership in Rust
View Cargo.toml
[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"
View env_file.sh
#!/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 Mar 13, 2018
Redirect HTTP to HTTPS Nginx
View nginx-https.md
server {
	listen 80 default_server;
	listen [::]:80 default_server;
	server_name _;
	return 301 https://$host$request_uri;
}

or

@kavichu
kavichu / flatten_array.exs
Created Apr 21, 2017
Elixir noob code to flatten array
View flatten_array.exs
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 Apr 17, 2017
OpenStack Triple O Troubleshooting - Installing openstack-tripleo-ui from rdo-trunk-newton-tested
View triple_o_summary.md

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 Apr 16, 2017
ES6 code to flatten array of arbitrarily nested arrays
View flatten_array.js
let arr = [[1,2,[3]],4];
let flatten = (accu, e) => {
if(!Array.isArray(e)){
return [...accu, e];
}else{
return [...accu, ...e.reduce(flatten, [])];
}
}
@kavichu
kavichu / index.html
Last active Feb 1, 2017
Itaipu Dam Organization diagram example
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title></title>
<!-- stylesheets -->
<link rel="stylesheet" href="https://rawgit.com/lvlds/treant-js/master/Treant.css" type="text/css"/>
</head>
@kavichu
kavichu / index.html
Last active Feb 1, 2017
Basic Treant-js example
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title></title>
<!-- stylesheets -->
<link rel="stylesheet" href="https://rawgit.com/lvlds/treant-js/master/Treant.css" type="text/css"/>
</head>
@kavichu
kavichu / latinoware2016.js
Created Oct 20, 2016
Docker + Jenkins + NodeJS + DigitalOcean
View latinoware2016.js
let shine = () => {
let table = jQuery(`table[id^="table"]`);
let filters = jQuery(`#ctl0_ctl1 > div.content-viewprogram.content > fieldset > div > label:nth-child(1) > span`);
const td = jQuery(`table tbody tr:nth-child(1) td:nth-child(9)`);
const cellContent = td.find("div.CellContent");
td.css("background-color"," black");
cellContent.css("background-color"," black");
cellContent.css("font-size", "18px");
table.css("width", "60%");