Skip to content

Instantly share code, notes, and snippets.

@gugaalves
gugaalves / functions.php
Created July 17, 2014 23:30
Vendo qual arquivo do tema está rodando!
add_action('admin_bar_menu', 'show_template');
function show_template() {
global $template;
print_r($template);
}
@ricardoriogo
ricardoriogo / jquery.validate.cnpj.js
Last active April 20, 2017 13:40
CNPJ validation for jQuery Validate
jQuery.validator.addMethod("cnpj", function(cnpj, element) {
var numeros, digitos, soma, resultado, pos, tamanho,
digitos_iguais = true;
if (cnpj.length < 14 && cnpj.length > 15)
return false;
for (var i = 0; i < cnpj.length - 1; i++)
if (cnpj.charAt(i) != cnpj.charAt(i + 1)) {
@mbreit
mbreit / font-awesome.css.sass
Last active March 29, 2021 04:52
Using Font Awesome with SASS and mixins for adding icons to semantic HTML
$fontawesome_path: "." !default
@font-face
font-family: 'FontAwesome'
src: font-url('#{$fontawesome_path}/fontawesome-webfont.eot')
src: font-url('#{$fontawesome_path}/fontawesome-webfont.eot?#iefix') format("embedded-opentype"), font-url('#{$fontawesome_path}/fontawesome-webfont.woff') format("woff"), font-url('#{$fontawesome_path}/fontawesome-webfont.ttf') format("truetype")
font-weight: normal
font-style: normal
@mixin icon($icon)
<?php
class WPLazyLoadImages {
function __construct() {
// Add Our Filters and actions for the plugin
add_action('wp_enqueue_scripts', array($this, 'enqueue_lazyload'));
add_filter('the_content', array($this, 'filter_lazyload'));
add_action('wp_footer', array($this, 'footer_lazyload'));
@sainnhe
sainnhe / lightline-and-tmux-config.md
Last active October 26, 2022 23:52
Sexy & Powerful Configuration for Lightline and Tmux

𝑺𝒆𝒙𝒚 & 𝑷𝒐𝒘𝒆𝒓𝒇𝒖𝒍 𝑪𝒐𝒏𝒇𝒊𝒈𝒖𝒓𝒂𝒕𝒊𝒐𝒏 𝒇𝒐𝒓 𝑳𝒊𝒈𝒉𝒕𝒍𝒊𝒏𝒆 𝒂𝒏𝒅 𝑻𝒎𝒖𝒙

Nerd Font

First of all, install a nerd font, and apply it: nerd font

@craigmdennis
craigmdennis / _debug.scss
Last active March 21, 2023 02:31
Sass mixins for vertical rhythm and scoped typography with pixel fallback for IE.
$debug-rhythm: false;
@googleinurl
googleinurl / facecheck2.0.php
Last active April 20, 2023 18:59
Verificação de usuários Facebook 2.0
<?php
/*
E d i ç ã o - 2.0 / 29-09-2015
--------------------------------------------------------------------------------
[+] AUTOR: Cleiton Pinheiro / Nick: googleINURL
[+] Blog: http://blog.inurl.com.br
--------------------------------------------------------------------------------
*/
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@jasdeepkhalsa
jasdeepkhalsa / imageCropAdvanced.php
Created December 19, 2012 20:02 — forked from anonymous/imageCropAdvanced.php
Using PHP and GD to crop an image proportionally according to its aspect ratio. From: http://stackoverflow.com/questions/1855996/crop-image-in-php
<?php
$image = imagecreatefromjpeg($_GET['src']);
$filename = 'images/cropped_whatever.jpg';
$thumb_width = 200;
$thumb_height = 150;
$width = imagesx($image);
$height = imagesy($image);
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */