This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* STYLESHEETS | |
*/ | |
function print_device_styles( $client = 'desktop' ) | |
{ | |
$client = apply_filters( 'set_theme_client', $client ); | |
wp_enqueue_style( $client.'-css' ); | |
} | |
add_action( 'wp_head', 'print_device_styles', 11 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var io = require('socket.io').listen(8000), | |
nicknames = {}; | |
io.sockets.on('connection', function (socket) { | |
socket.on('user message', function (msg) { | |
socket.broadcast.emit('user message', socket.nickname, msg); | |
}); | |
socket.on('nickname', function (nick, fn) { | |
if (nicknames[nick]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Code goes in functions.php or a custom plugin. | |
*/ | |
add_action( 'woocommerce_email', 'unhook_those_pesky_emails' ); | |
function unhook_those_pesky_emails( $email_class ) { | |
/** | |
* Hooks for sending emails during store events | |
**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Prevent Category Deletion | |
Plugin URI: http://wordpress.stackexchange.com/q/70758/12615 | |
Description: Prevent deletion of categories. Modify the $undeletable array to suit your setup. Use Category SLUGS. | |
Author: brasofilo | |
Version: 1.0 | |
Author URI: http://wordpress.stackexchange.com/users/12615/brasofilo | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter("the_content", "the_content_filter"); | |
function the_content_filter($content) { | |
// array of custom shortcodes requiring the fix | |
$block = join("|",array("col","shortcode2","shortcode3")); | |
// opening tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Homepage Settings for BigBang | |
Plugin URI: http://www.inboundnow.com/ | |
Description: Adds additional functionality to the big bang theme. | |
Author: David Wells | |
Author URI: http://www.inboundnow.com | |
*/ | |
// Specify Hooks/Filters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS location; | |
CREATE TABLE IF NOT EXISTS `location` ( | |
`locId` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`country` varchar(2) DEFAULT NULL, | |
`region` varchar(2) DEFAULT NULL, | |
`city` varchar(1000) DEFAULT NULL, | |
`postalCode` varchar(10) DEFAULT NULL, | |
`latitude` float DEFAULT NULL, | |
`longitude` float DEFAULT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check Iranian National Code Validity - Clojure, C#, F#, Ruby, JavaScript, Dart, Python, Scala, Java 8, PHP, C, Go, Swift, Kotlin, Groovy, Rust, Haskell, Erlang, Elixir, Power Query M Language, VBA, R, Lua, Fortran, Pascal/Delphi, Excel, Stored Procedure / MySQL | |
// بررسی صحت کد ملی ایران - کلوژر، سیشارپ، افشارپ، روبی، جاوااسکریپت، دارت، پایتون، اسکالا، جاوا ۸، پیاچپی، سی، گو، سوئیفت، کاتلین، گرووی، راست، هسکل، ارلنگ، الکسیر، پاورکوئری ام، ویبی ای، آر، لوآ، فرترن، پاسکال/دلفی، اکسل، مایاسکیوال | |
// در نسخههای قبل یکسان بودن اعداد نا معتبر تشخیص داده میشد ولی | |
// اعداد یکسان نامعتبر نیست https://web.archive.org/web/20170706081048/http://www.fardanews.com/fa/news/127747/رندترین-شماره-ملی-بلای-جان-صاحبش-شد | |
// بعضی از پیادهسازیها سریع نیستند، میتوانید نسخهٔ خود را بر پایهٔ | |
// نسخهٔ سی یا گو ایجاد کنید که بهترین سرعت را داشته باشد | |
/** |
OlderNewer