Skip to content

Instantly share code, notes, and snippets.

@leandrodaher
leandrodaher / gist:456076f7ac844485b5552ec4a2071a63
Created July 25, 2023 14:16 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@leandrodaher
leandrodaher / README.md
Created August 14, 2023 12:11 — forked from vinicius-stutz/README.md
Máscara p/ telefones com 8 ou 9 dígitos (jquery.mask.js)
@leandrodaher
leandrodaher / gist:fb5b5b20cb6c5abb7db0a79277eda74f
Created August 14, 2023 19:30 — forked from galaakk/gist:3679211
jQuery : Scroll to anchor
$(document).ready(function() {
// Click event for any anchor tag that's href starts with #
$('a[href^="#"]').click(function(event) {
// The id of the section we want to go to.
var id = $(this).attr("href");
// An offset to push the content down from the top.
var offset = 60;
@leandrodaher
leandrodaher / Stats.js
Created August 21, 2023 19:23 — forked from rygorous/Stats.js
Half-space tri rasterizers in JS
// stats.js r9 - http://github.com/mrdoob/stats.js
var Stats=function(){var h,a,r=0,s=0,i=Date.now(),u=i,t=i,l=0,n=1E3,o=0,e,j,f,b=[[16,16,48],[0,255,255]],m=0,p=1E3,q=0,d,k,g,c=[[16,48,16],[0,255,0]];h=document.createElement("div");h.style.cursor="pointer";h.style.width="80px";h.style.opacity="0.9";h.style.zIndex="10001";h.addEventListener("mousedown",function(a){a.preventDefault();r=(r+1)%2;0==r?(e.style.display="block",d.style.display="none"):(e.style.display="none",d.style.display="block")},!1);e=document.createElement("div");e.style.textAlign=
"left";e.style.lineHeight="1.2em";e.style.backgroundColor="rgb("+Math.floor(b[0][0]/2)+","+Math.floor(b[0][1]/2)+","+Math.floor(b[0][2]/2)+")";e.style.padding="0 0 3px 3px";h.appendChild(e);j=document.createElement("div");j.style.fontFamily="Helvetica, Arial, sans-serif";j.style.fontSize="9px";j.style.color="rgb("+b[1][0]+","+b[1][1]+","+b[1][2]+")";j.style.fontWeight="bold";j.innerHTML="FPS";e.appendChild(j);f=document.createElement("div");f.style.position="relati

After a couple hesitating months to move to github pages, and from my hacked together static site generator, yesterday was my 4th attempt in getting started with github pages blogging, just because there where a few annoyances with the different variations I've tried.

Decided to go with Octopress, just for their nice logo. And for their Github pages oriented focus. That didn't pan out, but at least I learned a few things about their blogging process and setup, which I'm adapting for sculpin.

Sculpin for Github pages (Déjà vu)

@leandrodaher
leandrodaher / folder_structure.md
Created October 9, 2023 15:00 — forked from ayoubzulfiqar/folder_structure.md
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@leandrodaher
leandrodaher / gist:2f08c775690c0e3d31dc4b40b0d5e60f
Created October 16, 2023 13:24 — forked from johnballantyne/gist:4089627
GetMultiCellHeight() script for FPDF
function GetMultiCellHeight($w, $h, $txt, $border=null, $align='J') {
// Calculate MultiCell with automatic or explicit line breaks height
// $border is un-used, but I kept it in the parameters to keep the call
// to this function consistent with MultiCell()
$cw = &$this->CurrentFont['cw'];
if($w==0)
$w = $this->w-$this->rMargin-$this->x;
$wmax = ($w-2*$this->cMargin)*1000/$this->FontSize;
$s = str_replace("\r",'',$txt);
$nb = strlen($s);
@leandrodaher
leandrodaher / product.proto
Created October 19, 2023 17:14 — forked from argentinaluiz/product.proto
Protofile do desafio da Imersão Full Cycle
syntax = "proto3";
package github.com.codeedu.codepix;
option go_package = "protofiles/pb";
service ProductService {
rpc CreateProduct (CreateProductRequest) returns (CreateProductResponse) {};
rpc FindProducts(FindProductsRequest) returns (FindProductsResponse) {};
}
@leandrodaher
leandrodaher / image-zoom.js
Created November 1, 2023 14:27 — forked from JamesKyburz/image-zoom.js
image-zoom.js
zoom(window.document.querySelector('img'))
function zoom (img) {
let canvas
if (img.width) {
load()
} else {
img.addEventListener('load', load)
}
@leandrodaher
leandrodaher / .block
Created November 27, 2023 11:57 — forked from mbostock/.block
Programmatic Pan+Zoom
license: gpl-3.0
redirect: https://observablehq.com/@d3/programmatic-zoom