Skip to content

Instantly share code, notes, and snippets.

View shamimmoeen's full-sized avatar
🏠
Working from home

Mainul Hassan Main shamimmoeen

🏠
Working from home
View GitHub Profile
@taupecat
taupecat / hover-state.scss
Created February 8, 2013 14:47
I'm tired of writing a { &:hover, &:active, &:focus { [blah blah blah] } } all the time in my SCSS. So I wrote a mixin. I can probably make this better. Later.
@mixin hover-state {
&:hover, &:active, &:focus {
@content;
}
}
a {
text-decoration: none;
@include hover-state {
@cyberwani
cyberwani / modify_query.php
Created March 12, 2014 07:35
Modify WordPress Query query
<?php
// With dual parameters
function modify_query_one( $clauses, $query ) {
global $wpdb;
if ( isset( $query->query['orderby'] ) && 'color' == $query->query['orderby'] ) {
$clauses['join'] .= <<<SQL
LEFT OUTER JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID={$wpdb->term_relationships}.object_id
LEFT OUTER JOIN {$wpdb->term_taxonomy} USING (term_taxonomy_id)
LEFT OUTER JOIN {$wpdb->terms} USING (term_id)
@eteubert
eteubert / scaffolding.php
Created November 5, 2011 10:01
WordPress: Tab Layout for Settings Pages
<?php
// initialize plugin
if ( function_exists( 'add_action' ) && function_exists( 'register_activation_hook' ) ) {
add_action( 'plugins_loaded', array( 'tabbed_plugin', 'get_object' ) );
}
class tabbed_plugin
{
// singleton class variable
static private $classobj = NULL;
@wpscholar
wpscholar / .eslintignore
Last active March 14, 2022 10:21
Webpack 4 Config for WordPress plugin, theme, and block development
**/*.min.js
**/*.build.js
**/node_modules/**
**/vendor/**
build
coverage
cypress
node_modules
vendor
@yhara
yhara / gist:1408888
Created November 30, 2011 12:22 — forked from avalanche123/gist:981817
GitHub Emoji (sort by category)
emotion :+1: :-1: :clap: :heart: :sparkles: :v: :zzz:
icon :new: :ok: :cool: :vs: :tm: :warning: :wheelchair: :zap: :art: :bomb: :bulb: :key: :lock: :memo: :mag:
item :book: :gift: :moneybag: :mega: :scissors: :hammer:
device :computer: :iphone: :calling: :email:
human :cop: :runner: :feet: :fist: :punch: :lipstick: :tophat:
food :beer: :cake: :smoking:
behicle :airplane: :bike: :bus: :ski: :taxi: :train:
animal :bear: :fish: :octocat:
nature :fire: :leaves: :star: :sunny:
@bdimcheff
bdimcheff / jquery.query.js
Created June 22, 2012 21:58
jquery-query
/**
* http://plugins.jquery.com/project/query-object
* jQuery.query - Query String Modification and Creation for jQuery
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
* Date: 2009/8/13
*
* @author Blair Mitchelmore
* @version 2.1.7
*
@franhaselden
franhaselden / end-of-word.php
Last active October 21, 2022 08:26
Wordpress trim content to 100 characters
<?php
// Trims the_content. In place of excerpt, this allows us to output line breaks and styling
$post_content = get_the_content_with_formatting();
// Checks the string length, if under 500 chars...
if (strlen($post_content) < 500){
// Outputs the whole post content
print $post_content . '...';
}else{
// Output only 500 chars, but don't cut halfway through a word
$post_trimmed = substr($post_content, 0, strpos($post_content, ' ', 500));
@parth1020
parth1020 / Google Maps Simple Multiple Marker Example
Created January 8, 2013 07:04
Google Maps Simple Multiple Marker Example
<html>
<head>
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<div id="map" style="height: 400px; width: 500px;">
</div>
<script type="text/javascript">
@igorbenic
igorbenic / clauses.php
Last active February 21, 2024 21:34
Extending WP_Query with Custom Queries and Tables | https://www.ibenic.com/extending-wp-query-custom-queries-tables
<?php
add_filter( 'posts_clauses', 'filter_clauses', 10, 2 );
/**
* Filtering everything.
*
* @param array $clauses Array with all parts of the query.
* @param WP_Query $wp_query Object.
* @return string
@discordier
discordier / gist:ed4b9cba14652e7212f5
Created December 4, 2014 06:23
options for phpStorm @noinspection annotation
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection