Skip to content

Instantly share code, notes, and snippets.

View dsturm's full-sized avatar

Daniel Sturm dsturm

View GitHub Profile
@maxclaus
maxclaus / alias-docker-compose.sh
Last active August 27, 2023 15:11
Aliases for docker-compose
alias c='docker-compose'
alias cb='docker-compose build'
alias cup='docker-compose up'
alias cr='docker-compose run --service-ports --rm'
alias crl='docker-compose run --service-ports --rm local'
alias crd='docker-compose run --service-ports --rm develop'
alias crt='docker-compose run --rm test'
alias crp='docker-compose run --rm provision'
alias crci='docker-compose run --rm ci'
alias crwt='docker-compose run --rm watchtest'
@laurendorman
laurendorman / _cursor-mixins.scss
Last active August 8, 2019 10:49
Sass mixins + classes for cursors – For use with online photo editors, drag/drop tools, text editors and WYSIWYGs.
// Used to @include a cursor within a pre-existing class
@mixin cursor($cursor-type) {
cursor: $cursor-type;
}
// Used to generate cursor classes
@mixin cursor-class($cursor-type) {
.#{$cursor-type}-cursor { cursor: $cursor-type; }
}
@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.
@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;
@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 ) {
@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 */
@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
*/
@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;
@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;
<?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 ###############################################