Skip to content

Instantly share code, notes, and snippets.

View mathcale's full-sized avatar
💃

Matheus Calegaro mathcale

💃
View GitHub Profile
@mathcale
mathcale / gulpfile.js
Last active July 25, 2016 18:36
Simple Gulp workflow for Sass and Uglify JS
var gulp = require("gulp"),
sass = require("gulp-sass"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
ignore = require("gulp-ignore");
var sassInput = "sources/stylesheets/**/*.scss";
var sassOutput = "public/stylesheets";
var jsInput = "sources/javascripts/*.js";
var jsOutput = "public/javascripts";
@mathcale
mathcale / background.scss
Created January 5, 2016 18:55
Perfect-fit CSS background
// By CSS-Tricks (SASS-ed by me)
$bgImage: "path/to/image.jpg";
html {
background: url($bgImage) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@mathcale
mathcale / menuBacana.html
Created January 25, 2016 17:23
Submenu com efeito diagonal com CSS3 puro
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>Menu banaca CSS3</title>
<style>
* {
@mathcale
mathcale / passgen.php
Last active May 9, 2016 19:46
Simple password generator with PHP
<?php
// Setting up the timezone
date_default_timezone_set("America/Sao_Paulo");
// Grabbing the date and time
$now = date("YmdHis");
// Converting the date into a MD5 hash, reducing it to 8 characters, "shuffling" it and type-casting as string (why not?!)
$password = (string) str_shuffle(substr(md5($now), 0, 8));
// Conexoes
#define TRIGGER_PIN 12
#define ECHO_PIN 13
#define IN1 4
#define IN2 5
#define IN3 6
#define IN4 7
// Configs
int distanciaMaxima = 15;
@mathcale
mathcale / SendMessage.php
Last active January 13, 2017 17:04
Send email with PHP, jQuery, Validate and customized with Bootstrap
<?php
$name = filter_var($_POST["name"], FILTER_SANITIZE_STRING);
$email = filter_var($_POST["email"], FILTER_SANITIZE_EMAIL);
$message = filter_var($_POST["message"], FILTER_SANITIZE_STRING);
$to = "contact@yourcompany.com";
$subject = "YourCompany - Contact Message";
$msg = '<h3 style="font-family: sans-serif">Sender\'s info:</h3>
@mathcale
mathcale / estados.html
Last active July 24, 2018 13:15
Estados brasileiros em HTML, PHP e JS (separados)
<select id="uf" name="uf">
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
<option value="ES">Espirito Santo</option>
<option value="GO">Goiás</option>
@mathcale
mathcale / README.md
Last active June 4, 2020 01:27
My Ubuntu 18/Linux Mint 19 Setup
#!/bin/bash
function die {
declare MSG="$@"
echo "$0: Error: $MSG">&2
exit 1
}
@mathcale
mathcale / list-port.sh
Last active November 4, 2022 13:04
Lists which processes are using a specific port on macOS
# Change $PORT with the port you want to scan
sudo lsof -i -P | grep LISTEN | grep :$PORT