Skip to content

Instantly share code, notes, and snippets.

View elvismdev's full-sized avatar
🏴

Elvis Morales elvismdev

🏴
View GitHub Profile
@zimzat
zimzat / paydate_calculator.class
Created July 3, 2013 19:36
Part of a code challenge for a job application in 2007 was to create a pay date calculator. Presented here is the exact code created for it over 6 years ago. Needless to say some of my coding practices and styles have further developed since that time, such as placing the trailing parenthesis on a separate line, using lowerCamelCase for variable…
<?php
class Paydate_Calculator {
/**
* Indicate if we're going forward (1) or backward (-1) when we make our adjustments.
* @var int
*/
private $due_date_adjustment = 1;
/**
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
@malixsys
malixsys / app.scss
Last active July 11, 2016 07:42
ionic framework validation
form i.icon.error {
color: $assertive;
}
form input + i.icon.error {
display: none;
margin-left: 8px;
}
form.ng-submitted input.ng-invalid + i.icon.error {
@mbijon
mbijon / posts_search_demo.php
Created February 18, 2013 18:48
WordPress posts_search filter example, for Tom Barrett on WP-Hackers list 2013-02-18
function tcb_filter_search( $term ) {
if ( is_search() )
$search = "(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))";
return $search;
}
add_filter( 'posts_search', 'tcb_filter_search', null, 2 );
{
"name": "shelob9/router-experiment",
"require": {
"silex/silex": "~1.3",
"twig/twig": "^2.0@dev"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"shelob9\\router\\": "src"
@srikat
srikat / functions.php
Last active March 20, 2017 15:08
How to add Beautiful Pro’s mobile responsive menu in other Genesis themes. http://sridharkatakam.com/add-beautiful-pros-mobile-responsive-menu-genesis-themes/
// Enqueue scripts and styles
add_action( 'wp_enqueue_scripts', 'custom_scripts_styles_mobile_responsive' );
function custom_scripts_styles_mobile_responsive() {
wp_enqueue_script( 'beautiful-responsive-menu', get_stylesheet_directory_uri() . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_style( 'dashicons' );
}
@shirshir
shirshir / ExtendedMonologServiceProvider.php
Created January 14, 2014 08:39
A Silex Service Provider to add Monolog\Handler\BufferHandler, Monolog\Handler\FingersCrossedHandler and Symfony\Bridge\Monolog\Handler\SwiftMailerHandler to email any errors. Silex\Provider\MonologServiceProvider must also be registered.
<?php
namespace App\Provider;
use Monolog\Handler\BufferHandler;
use Monolog\Handler\FingersCrossedHandler;
use Monolog\Logger;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Symfony\Bridge\Monolog\Handler\SwiftMailerHandler;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
@henocdz
henocdz / tooltipster-dynamic-color.js
Last active August 11, 2017 07:09
Tooltipster dynamic color on hover
$('.tooltip').tooltipster({
functionBefore: function(origin, continueTooltip){
continueTooltip();
var color = origin.data('color');
if(!color){ return false; }
$('.tooltipster-default').css({
'background-color': color
});
@imjjss
imjjss / gist:2837942
Created May 30, 2012 17:54
hide gallery settings
function hide_gallery_settings()
{
echo '<style type="text/css">#gallery-settings{display:none;}</style>';
}
@spivurno
spivurno / gw-gravity-forms-multi-form-export.php
Last active November 8, 2017 21:58
DEPRECATED: Gravity Wiz // Gravity Forms // Multi-form Entry Exporter
<?php
/**
* Gravity Wiz // Gravity Forms // Multi-form Entry Exporter
*
* Allows you create a custom entry export containing fields from multiple forms. The custom export
* is then displayed in the "Form" drop down menu in a "Multi-form Export" option group.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+