Skip to content

Instantly share code, notes, and snippets.

View dsturm's full-sized avatar

Daniel Sturm dsturm

View GitHub Profile
@jacquesletesson
jacquesletesson / wp-event-calendar-permalink-with-date.php
Last active October 20, 2016 00:20
The Event Calendar - Permalink with starting date injected automatically.
@tommymarshall
tommymarshall / composer.json
Created February 25, 2015 14:48
ACF composer
{
"type": "package",
"package": {
"name": "advanced-custom-fields/advanced-custom-fields-pro",
"version": "5.1.9.1",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
"url": "http://connect.advancedcustomfields.com/index.php?p=pro&a=download&k=YOUR_KEY_HERE="
}
<?php
if(!defined('WPINC')) // MUST have WordPress.
exit('Do NOT access this file directly: '.basename(__FILE__));
add_action('init', 'github_events::init');
class github_events // Event handler.
{
# Configuration ###############################################
@vburlak
vburlak / vc2twbs3classes
Last active April 29, 2020 15:24
Replace Visual Composer initial classes with original Bootstrap 3 classes
/**
* Replace Visual Composer initial classes with original Bootstrap 3 classes
*
* @author http://codecanyon.net/user/adambartholomew1
* @source from http://pastebin.com/qJp9SXvP
* @package vc2twbs3classes
* @version 0.1
*/
$lCounter = 0;
@AllThingsSmitty
AllThingsSmitty / css-not.scss
Last active November 28, 2018 16:16
Use CSS :not() instead of applying and unapplying borders on navigations
.nav-tab {
...
// instead of putting it on
border-right: 1px solid #424242;
&:last-child {
border-right: 0; // and then taking it off
}
// use CSS not() to only apply to the elements you want
&:not(:last-child) {
border-right: 1px solid #424242;
@JRGould
JRGould / wp-migrate-db-pro-tweaks.php
Created August 5, 2015 19:19
WP Migrate DB Pro Tweaks - edited to allow utf8mb4 to utf8 migrations
<?php
/*
Plugin Name: WP Migrate DB Pro Tweaks
Plugin URI: http://github.com/deliciousbrains/wp-migrate-db-pro-tweaks
Description: Examples of using WP Migrate DB Pro's filters
Author: Delicious Brains
Version: 0.1
Author URI: http://deliciousbrains.com
*/
@thiagoeliasr
thiagoeliasr / swiper-magnific-popup.js
Created August 13, 2015 13:27
Adding swipe support to Magnific Popup galleries. (touchSwipe is required: http://labs.rampinteractive.co.uk/touchSwipe/demos/)
(function() {
/* Define a variável que dá swipe no lightbox */
var magnificPopup = $.magnificPopup.instance;
/* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */
$("a.image-lightbox").click(function(e) {
/* Espera carregar o lightbox */
setTimeout(function() {
/* Swipe para a esquerda - Próximo */
@nciske
nciske / double-confirmation-fields.php
Last active February 8, 2016 15:03
Tweaked to allow a custom message
<?php
/**
* Double Confirmation Fields
* http://gravitywiz.com/2012/05/01/custom-field-confirmation/
*/
register_confirmation_fields( 10, array( 1, 2 ), 'Your custom messages do not match.' );
add_filter( 'gform_validation', 'gfcf_validation' );
function gfcf_validation( $validation_result ) {
@R41D3NN
R41D3NN / get-ipinfo.js
Last active May 21, 2023 00:51
Javascript for retrieving IP Address info using ipinfo.io API via AJAX.
var GetIpInfo = function(ipAddr) {
var info = null;
var infoUrl = "http://ipinfo.io/" + ipAddr;
$.ajax({
url: infoUrl,
type: 'GET',
dataType: 'json',
async: false,
success: function(data) {
info = data;
@helderco
helderco / db-open
Created October 6, 2015 14:51
Script to open a mysql database in Sequel Pro from a service in docker-compose.
#!/bin/bash
set -e
show_help() {
cat << EOF
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE]
${0##*/} -h
Open a standard connection in Sequel PRO.