Skip to content

Instantly share code, notes, and snippets.

// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@jonathonbyrdziak
jonathonbyrdziak / CustomWidgetFile.php
Last active September 29, 2022 22:00
EMPTY WIDGET Plugin code to create a single widget in wordpress.
<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
@splorp
splorp / comment-blacklist-for-wordpress.md
Last active November 26, 2023 08:47
Comment Blacklist Keywords for WordPress

Comment Blacklist for WordPress

Notice!

As of November 5th, 2013, this version of the blacklist will no longer be updated.

I have migrated the project to a full Git repository in order to better track changes, bugs, and feedback.

Check out Comment Blacklist for WordPress on GitHub.

@hakre
hakre / dl-file.php
Created January 2, 2012 21:41
Wordpress login to download uploaded files
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre <http://hakre.wordpress.com/>
* @license GPL-3.0+
@jo-snips
jo-snips / events-conditional-wrappers.php
Last active December 21, 2023 12:27
The Events Calendar: Basic Conditional Wrappers
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
@ttscoff
ttscoff / octopress.js
Created October 19, 2012 01:53
Quick function to check viewport size and chop/crop images (CSS3) for mobile views.
var bt = {}; // to call the functions outside of the jQuery wrapper because OctoPress is a bit of a JS mess. Hey, that rhymes.
(function($){
bt = {
checkWinWidth: function() {
var width = $(window).width();
if (width <= 500) {
if (!$('body').hasClass('mobile')) {
$('img').each(function(){
var $this = $(this);
@malarkey
malarkey / Contract Killer 3.md
Last active July 5, 2024 08:43
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@murtaugh
murtaugh / 1. single-line.html
Last active April 21, 2021 16:23
Blockquote patterns for ALA
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>
@patrickwelker
patrickwelker / Simple share buttons
Created January 23, 2013 17:36
Simple social share buttons for WordPress. It's worth a mention that if you use certain themes, they might use a special `%permalink%` and `%post-title%` structure. Be sure to replace the default `<?php the_title(); ?>` and `<?php the_permalink(); ?>` with it. #Facebook #Twitter #Google+
<a title="Share" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>">Share on Facebook</a>
<a title="Tweet" href="https://twitter.com/share?url=&text=<?php the_title(); ?>: <?php echo urlencode(get_permalink($post->ID)); ?> &via=YOUR-TWITTER-USERNAME&count=horizontal">Tweet This</a>
<a title="PlusOne" href="https://plusone.google.com/_/+1/confirm?hl=en&url=<?php the_permalink(); ?>">+1</a>
@sturobson
sturobson / user preferences
Last active March 31, 2021 11:36
My current sublime text 2 user preferences
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_indent": true,
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/Color Scheme - Default/Blackboard.tmTheme",
"detect_slow_plugins": false,
"draw_minimap_border": true,