Skip to content

Instantly share code, notes, and snippets.

View salviof's full-sized avatar

Salvio Furbino Elias salviof

View GitHub Profile
@andyshinn
andyshinn / Dockerfile
Last active August 8, 2023 08:39
Postal on Docker
FROM ruby:2.3-onbuild
VOLUME /opt/postal/config
ENV LOG_TO_STDOUT 1
ENV AM_CONFIG_ROOT /opt/postal/config
RUN gem install procodile
RUN apt-get update -qq && apt-get install -yqq nodejs
@chrisvanpatten
chrisvanpatten / README.md
Created March 7, 2012 16:27
WordPress Admin Tabs

Huh?

Believe it or not, WordPress doesn't have a fully-fleshed out common tab style for plugins or theme authors to use in metaboxes.

The style exists for categories, but it hasn't been fully adapted for the half-complete wp-tab setup. Trac ticket #17959 has a solution that not only fleshes the style but it also adds a global JavaScript file to give the wp-tab HTML some action. Until that ticket is accepted into core, this Gist adapts that code so it's available to use independently in your theme or plugin.

How?

Just enqueue the CSS and JavaScript in the admin_enqueue_scripts script hook and drop the tab HTML in a metabox. It will automatically adapt to the normal and side column widths, much like category tabs.

@tim-reynolds
tim-reynolds / jquery.centerit.js
Created June 29, 2012 18:16
Setting scroll to center on an element (jQuery) - Super simple stuff
/*
If you have a horizontal (or vertical) scroll container and want to set the scroll to center a specific
element in the container you can use the following super simple technique.
I'm going to show you how it was derived, because it's important to know why, not just how.
*/
/*
Setup:
[HTML]
<div class="outer">
package de.ppi.util;
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
import java.util.Arrays;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.codec.digest.DigestUtils;
@fhferreira
fhferreira / jquery-mask-nono-digito.js
Last active December 10, 2018 13:31
Jquery Mask Nono Digito
// jQuery Masked Input
$('#celular').mask("(99) 9999-9999?9").ready(function(event) {
var target, phone, element;
target = (event.currentTarget) ? event.currentTarget : event.srcElement;
phone = target.value.replace(/\D/g, '');
element = $(target);
element.unmask();
if(phone.length > 10) {
element.mask("(99) 99999-999?9");
} else {