This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function rw_image_resize( $attachment_id, $width, $height, $crop = true ) | |
| { | |
| $path = get_attached_file( $attachment_id ); | |
| if ( ! file_exists( $path ) ) | |
| { | |
| return false; | |
| } | |
| $upload = wp_upload_dir(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| # Shorthand for checkout | |
| co = checkout | |
| # Shorthand for branch | |
| br = branch | |
| # Shorthand for commit | |
| ci = commit | |
| # Shorthand for status | |
| st = status | |
| # Hide file from Git tracking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // of course gulp | |
| const {src, dest, parallel, series, watch} = require('gulp'); | |
| // variables | |
| const build = true; // true para compilar e minificar os arquivos - false para não minificar e nem usar babel (performance maior), use true para compilar o projeto final | |
| const jsBuildDir = './assets/dist/js/'; // diretório de destino do bundle.js compilado | |
| const cssBuildDir = './'; // diretório de destino do style.css compilado | |
| // css | |
| const sass = require('gulp-sass'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gsap from 'gsap' | |
| import ScrollTrigger from 'gsap/ScrollTrigger' | |
| import {SplitText} from 'gsap/SplitText' | |
| import CustomEase from 'gsap/CustomEase' | |
| gsap.registerPlugin(ScrollTrigger) | |
| gsap.registerPlugin(SplitText) | |
| document.addEventListener('DOMContentLoaded', () => { | |
| const animations = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Code that will fit the text to the card of project-grid-item if is only one word vanillajs | |
| */ | |
| const fitText = () => { | |
| const projectGridItems = document.querySelectorAll('.project-grid-item'); | |
| projectGridItems.forEach((item) => { | |
| const text = item.querySelector('.title'); | |
| // get length of words | |
| const textLength = text.innerText.split(' ').length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import importlib | |
| import subprocess | |
| import sys | |
| def install_and_import(package): | |
| try: | |
| importlib.import_module(package) | |
| except ImportError: | |
| subprocess.check_call([sys.executable, "-m", "pip", "install", package]) | |
| finally: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php function rh_image_size($attachment_id, $width = null, $height = null, $crop = true, $force_crop = false) { | |
| $path = get_attached_file($attachment_id); | |
| if (!file_exists($path)) { | |
| return false; | |
| } | |
| $upload = wp_upload_dir(); | |
| $path_info = pathinfo($path); | |
| $base_url = $upload['baseurl'] . str_replace($upload['basedir'], '', $path_info['dirname']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Função que altera o título da página de taxonomia 'category_photos'. | |
| * | |
| * @param string $title O título atual da página. | |
| * @return string O novo título da página. | |
| */ | |
| add_filter('pre_get_document_title', 'change_title_taxonomy_page', 10, 1); | |
| function change_title_taxonomy_page($title) { | |
| if (is_tax('category_photos')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @layer components { | |
| .gradient-border { | |
| @apply relative; | |
| &::after { | |
| @apply absolute inset-[-1px] pointer-events-none p-[1px] z-[1] bg-gradient-to-r from-transparent to-transparent; | |
| content : ''; | |
| z-index : 1; | |
| mask : linear-gradient(#fff 0 0) content-box, | |
| linear-gradient(#fff 0 0) border-box; | |
| -webkit-mask : linear-gradient(#fff 0 0) content-box, |
OlderNewer