Skip to content

Instantly share code, notes, and snippets.

View dleatherman's full-sized avatar
💭
🤘🏼

Dan Leatherman dleatherman

💭
🤘🏼
View GitHub Profile
@dleatherman
dleatherman / view_count.php
Created December 18, 2014 14:23
Youtube View Count
<?php
$video_ID = 'your-video-ID';
$JSON = file_get_contents("https://gdata.youtube.com/feeds/api/videos/{$video_ID}?v=2&alt=json");
$JSON_Data = json_decode($JSON);
$views = $JSON_Data->{'entry'}->{'yt$statistics'}->{'viewCount'};
echo $views;
?>
@dleatherman
dleatherman / mixins.less
Last active August 29, 2015 14:06
Starting Less Mixins
.icon(@filename, @bgcolor: transparent, @bgsize: contain) {
.text-hide;
background: @bgcolor url('icon-@{filename}.png') no-repeat center center;
background: @bgcolor url('icon-@{filename}.svg') no-repeat center center;
background-size: @bgsize;
display: inline-block;
}
.svgbg(@filename, @bgsize: contain) {
background: url('@{filename}.png') no-repeat center center;
@dleatherman
dleatherman / Preferences.sublime-settings —User
Last active August 29, 2015 14:06
Sublime Text 3 User Settings
{
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"font_face": "Source Code Pro",
"font_size": 10,
"ignored_packages":
[
"Vintage"
],
"spacegray_sidebar_tree_small": true,
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", ".sass-cache"],
@dleatherman
dleatherman / gist:ad0e794066e40ecc5a3c
Created August 26, 2014 15:01
Shopify add multiple items
addItem: function(variant_id, quantity, callback) {
var quantity = quantity || 1;
var params = {
type: 'POST',
url: '/cart/add.js',
data: 'quantity=' + quantity + '&id=' + variant_id + "&properties[foo]=fizzbuzz",
dataType: 'json',
success: function(line_item) {},
error: function(xhr, status) {}
};
.icon(@filename, @color: transparent, @background-size: contain) {
background: @color url('../img/@{filename}.png') no-repeat center center;
background: @color url('../img/@{filename}.svg') no-repeat center center;
background-size: @background-size;
display: block;
margin: 0 auto;
overflow: hidden;
text-indent: 100%;
white-space: nowrap;
}
// Bootstrap pagination
function bootstrap_pagination($pages = '', $range = 2) {
$showitems = ($range * 2)+1;
global $paged;
if(empty($paged)) $paged = 1;
if($pages == '') {
global $wp_query;
$pages = $wp_query->max_num_pages;
<a href="#" class="button" data-reveal-id="myModal2">Click Me For A Modal</a>
<div id="myModal" class="reveal-modal [expand, xlarge, large, medium, small]">
<h2>Awesome. I have it.</h2>
<p class="lead">Your couch. It is mine.</p>
<p>Im a cool paragraph that lives inside of an even cooler modal. Wins</p>
<a class="close-reveal-modal">&#215;</a>
</div>
<form class="custom">
<!-- Custom Radio -->
<div class="row">
<div class="four columns">
<label for="radio1"><input name="radio1" type="radio" id="radio1" style="display:none;"><span class="custom radio"></span> Radio Button 1</label>
<label for="radio2"><input name="radio1" type="radio" id="radio2" style="display:none;"><span class="custom radio checked"></span> Radio Button 2</label>
<label for="radio3"><input name="radio1" type="radio" id="radio3" disabled style="display:none;"><span class="custom radio"></span> Radio Button 3</label>
</div>
<div class="four columns">
<a href="#" class="large secondary button radius">Back</a>
<a href="" class="medium secondary button radius">Scan</a>
<a href="" class="small secondary button radius">Skip &raquo;</a>