Skip to content

Instantly share code, notes, and snippets.

@andershaig
andershaig / _deals.scss
Created June 8, 2016 00:23
Secondary header for Deals tab
$deals-header-height: 48px;
.deals-view-page {
padding-top: $nav-height + $deals-header-height;
}
// Page Header
.deals-header {
@include transition(transform 150ms ease);
width: 100%;
height: $deals-header-height;
@andershaig
andershaig / index.html
Created March 14, 2014 16:44
Truncating based on a maximum length looking for the last period
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<body>
<output id="op">Smart Truncate:<br></output>
</body>
@andershaig
andershaig / default.liquid
Last active August 29, 2015 13:56 — forked from nitishn/app.js
<!-- This would go within the {% if sweeps_settings.completed %} section -->
<div id="ref-id" data-id="{{ sweeps_settings.referral_id }}"></div>
@andershaig
andershaig / frame-checker-cookie.js
Created November 8, 2013 20:45
Make it a little more difficult to view a page outside of an iframe
@andershaig
andershaig / stories.js
Created September 3, 2013 19:07
Stories Plugin to JS Object
var storiesToJSON = function (callback) {
var data = { "stories": [] };
var storiesAnswers = $('.stories_recent_activity li');
storiesAnswers.each( function (i, answer) {
var story = {};
story.image_url = $(this).find('.stories_user_image img').attr('src');
story.user_name = $(this).find('.stories_answer a').text();
story.user_link = $(this).find('.stories_answer a').attr('href');
@andershaig
andershaig / stories.js
Last active December 21, 2015 20:19
Stories Plugin - Limit Visible Entries
// Hide all stories except for the first X
// (0-based index - e.g. subtract 1 from the number of answers you want to show)
$('.stories_recent_activity ol li:gt(X)').hide();
// Examples
// Show only 1 item
$(document).ready( function () {
$('.stories_recent_activity ol li:gt(0)').hide();
});
{% plugin rawtext button_1_label %}
{% plugin rawtext button_1_link %}
{% plugin rawtext button_2_label %}
{% plugin rawtext button_2_link %}
{% plugin rawtext button_3_label %}
{% plugin rawtext button_3_link %}
{% plugin rawtext button_4_label %}
{% plugin rawtext button_4_link %}
<style type="text/css">
html {
@andershaig
andershaig / after.liquid
Created August 21, 2013 22:56
Redirect Fix
{% plugin rawtext page_url %}
<script type="text/javascript">
if (!document.body.className.match('page_preview')) {
// Redirects as soon as possible
setInterval( function () {
top.location.replace({{ page_url | json }});
},250);
}
</script>
@andershaig
andershaig / demo.css
Created August 19, 2013 19:02
If the following CSS was applied, which lines would be affected?
#main {
background: red;
}
@andershaig
andershaig / example-3.css
Created August 19, 2013 18:55
If the following CSS was applied, which lines would be affected?
li:nth-child(3n + 1) {
background: red;
}