Skip to content

Instantly share code, notes, and snippets.

View werner's full-sized avatar
🏠
Working from home

Werner Echezuría werner

🏠
Working from home
View GitHub Profile
@werner
werner / gist:86cd63c90b0ba47c8971b8d3a1d3cf97
Last active January 17, 2020 23:24
Machine learning notes
Focus on data analysis. Data is more important, because we already have the tools for mathematical operations, however is good to be familiar with the models available because some might work better than others.
Seems it needs a lot of trial and error.
Categorical attributes are repetitive values, that's why numeric fields could be categorical.
https://www.dummies.com/education/math/statistics/why-standard-deviation-is-an-important-statistic/
The std
row shows the standard deviation, which measures how dispersed the values are.
@werner
werner / my_flatten.rb
Created January 21, 2020 21:56
Custom flatten implementation
require "test/unit"
class Array
##
# Creates a new array, taking all elements into one or more dimensions, depending on the argument.
# If no argument is set, the array dimension will be one.
#
# +examples:+
#
@werner
werner / prev_cap.rb
Created October 8, 2020 14:33
Figure it out if the branch I'm working on is updated to master remote
local_commit = `git rev-parse HEAD`
raw_remote_commit = `git ls-remote --heads --quiet`
remote_commit = raw_remote_commit.split(/\s/)[0].strip
search_in_commits = `git log | grep #{remote_commit}`
puts 'Branch not merged with master' if search_in_commits == ''
FROM rust:1.51.0
WORKDIR /usr/src
RUN cargo new project --bin
WORKDIR /usr/src/project
RUN echo 'actix-web = "3"' >> Cargo.toml
RUN echo 'diesel = { version = "1.4.4", features = ["sqlite"] }' >> Cargo.toml
RUN echo 'dotenv = "0.15.0"' >> Cargo.toml
RUN echo 'serde = { version = "1.0", features = ["derive"] }' >> Cargo.toml
RUN echo 'serde_json = "1.0"' >> Cargo.toml
[[{"id":1,"name":"army boots","cost":12.34,"active":true},[]],[{"id":2,"name":"athletic shoes","cost":10.67,"active":true},[]],[{"id":3,"name":"ballet shoes","cost":9.87,"active":true},[]],[{"id":4,"name":"cowboy boots","cost":19.47,"active":true},[]],[{"id":5,"name":"dress shoes","cost":25.99,"active":true},[]],[{"id":6,"name":"flip-flops","cost":5.88,"active":true},[]],[{"id":7,"name":"high heels","cost":29.99,"active":true},[]],[{"id":8,"name":"moccasins","cost":21.99,"active":true},[]],[{"id":9,"name":"platform shoes","cost":31.99,"active":true},[]],[{"id":10,"name":"running shoes","cost":20.99,"active":true},[]]]