Skip to content

Instantly share code, notes, and snippets.

View jonasmello's full-sized avatar

Jonas Mello jonasmello

View GitHub Profile
@jonasmello
jonasmello / dummyimage.ts
Created October 11, 2023 18:39
Gerador de Cores e Imagem para placeholder
const a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'];
const genCol = (length = 6) => {
let text = '';
if (length > 1) {
for (let i = 0; i < length; i++) {
text += `${a[Math.floor(Math.random() * 15)]}`;
}
}
[core]
editor = code --wait
[alias]
last = log -1 HEAD
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
s = !git status
c = !git commit -m
l = !git log --pretty=format:'%C(blue)%h%C(red)%d %C(white)%s - %C(cyan)%cn, %C(green)%cr'
@jonasmello
jonasmello / _vimrc
Created January 9, 2018 19:08
Vimrc file for Windows. Put on ~/ directory
execute pathogen#infect()
syntax on
filetype plugin indent on
set number
colorscheme twilight256
let g:airline_powerline_fonts = 1
@jonasmello
jonasmello / gulpfile.js
Last active October 31, 2017 02:06
Sample of gulpfile.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
sourcemaps = require('gulp-sourcemaps'),
imagemin = require('gulp-imagemin'),
livereload = require('gulp-livereload'),
autoprefixer = require('gulp-autoprefixer'),
notify = require("gulp-notify"),
del = require('del');
@jonasmello
jonasmello / get_video_by_url.php
Last active July 13, 2020 13:00
Convert Youtube or Vimeo url to iframe
<?php
function get_video_by_url($url, $params = null)
{
if (!is_string($url)) return false;
$regexVM = '~
# Match Vimeo link and embed code
(?:<iframe [^>]*src=")? # If iframe match up to first quote of src
(?: # Group vimeo url
@jonasmello
jonasmello / mask_fone.js
Created December 20, 2015 21:48
Mask mascara telefone phone fone
//http://cdnjs.com/libraries/jquery.meiomask
//https://github.com/fabiomcosta/jquery-meiomask
$('input#telefone').setMask({
mask: '(99) 9999-99999',
autoTab: false
}).on("keyup change", function() {
var $this = $(this);
if ($this.val().length <= 14) {
$this.setMask({
mask: '(99) 9999-99999',
@jonasmello
jonasmello / Gruntfile.js
Created July 16, 2015 14:05
Configuração do Grunt
var mozjpeg = require('imagemin-mozjpeg');
module.exports = function (grunt) {
var json = {
js: {
src: [
'src/js/jquery-1.11.2.js',
'src/js/SmoothScroll.js',
'src/js/main.js',
],
dest: 'assets/js/main.js',
@jonasmello
jonasmello / wordpress-loop.php
Last active February 23, 2016 00:24
Wordpress Loop
<?php
wp_reset_query();
$args = array(
"post_type" => "post_type",
"orderby" => "menu_order"
);
$wp_query = new WP_Query();
$wp_query->query($args);
if ( $wp_query->have_posts() )
{