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
{% comment %} | |
Shopify responsive product images with srcset. | |
Example: | |
Include this snippet on a product page or within a products loop: | |
{% include 'product-image-srcset', | |
sizes: '(max-width: 640px) 50vw, (min-width: 641px) and (max-width: 960px) 33vw, 25vw' %} |
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
<form id="form1"> | |
<input name="name" value="Zac"> | |
<input name="address" value="407 French Road"> | |
<select name="gender"> | |
<option></option> | |
<option selected>Male</option> | |
<option>Female</option> | |
</select> | |
</form> |
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 | |
/* | |
This snippet hides locked fields on the profile edit form. | |
Add to `wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php` | |
immediately after <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> (near line 22): | |
*/ | |
<?php if ( in_array( bp_get_the_profile_field_name(), bp_get_locked_profile_fields() )) { continue; } ?> |
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
Selectize.define('persist_initial_options', function(options) { | |
var self = this, | |
initialOptions = []; | |
this.onInitialize = (function() { | |
var original = self.onInitialize; | |
initialOptions = Object.keys(self.options); | |
})(); | |
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
dayone://post?entry=Food Log | |
|Food Log|| | |
|:---|:---| | |
|Meal|[list: Which meal?|Breakfast|Lunch|Dinner|Snack]| | |
|Foods|[prompt:What did you eat?]| | |
|Notes|[prompt:Extra thoughts?]| | |
#food #log |
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 | |
if ($_SERVER['REQUEST_METHOD']=='POST') { | |
$json = json_decode(@file_get_contents('php://input')); | |
print_r($json); | |
} |
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 | |
$content = preg_replace('/(href|src)="((?!(.+:\/\/)|(.+:)|\/).*)"/','\1="/\2"',$content); | |
# Raw regex: (href|src)="(?!(.+://)|(.+:)|/).*" |
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
#!/usr/bin/perl | |
use LWP::Simple; | |
%stocks = ( | |
'AAPL' => [{'q'=>100,'p'=>75.00 }], | |
'MXIM' => [{'q'=>100,'p'=>28.82 }], | |
'LLTC' => [{'q'=>200,'p'=>31.25 }], | |
'YHOO' => [{'q'=>100,'p'=>23.46 }], | |
'WU' => [{'q'=>125,'p'=>21.09 }, | |
{'q'=>125,'p'=>21.97 }] |
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
/* | |
Occasionally you need to eliminate the gutters from your grid columns. Include | |
this SCSS in your project and add a class of .row-nogutter to any <div class="row"> | |
to magically remove its gutters. Not incredibly well-tested, but works for me. | |
This currently only works for standard (non-fluid) grids. | |
*/ |
NewerOlder