Skip to content

Instantly share code, notes, and snippets.

View ardeay's full-sized avatar
🍊

Randy Apuzzo ardeay

🍊
View GitHub Profile
@ardeay
ardeay / page.tpl
Last active November 17, 2015 04:10
<h1>/Page Title</h1>
<hr/>
{{if @my_cookie == 'developer'}}
<p>{{page.content_for_developers}}</p>
<a href="/link/for/developers/">Sign up you Code Monkey!</a>
{{else}}
@ardeay
ardeay / loader.tpl
Last active November 17, 2015 04:08
{{@my_cookie = {get_var.ct} }}
<div class="container">
{{current_view}}
</div>
https://mydomain.com/page/?ct=developer
<h1>Page Title</h1>
<hr/>
{{if $_sesvar == 'developer'}}
<p>{{page.content_for_developers}}</p>
<a href="/link/for/developers/">Sign up you Code Monkey!</a>
{{else}}
{{$_sesvar = {get_var.ct} }}
<div class="container">
{{current_view}}
</div>
https://mydomain.com/page/?st=developer
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
<script type="text/javascript">
createCookie('test_cookie','cookie content',7);
var x = readCookie('test_cookie')
if (x) {
alert('wooo my cookie: ' + x);
}
@ardeay
ardeay / page.tpl
Last active November 17, 2015 18:33
<h1>Page Title</h1>
<hr/>
{{if @test_cookie == 'cookie content'}}
<h2>{{@test_cookie}}</h2>
<p>{{page.personlized_content}}</p>
{{else}}
@ardeay
ardeay / social_curator_example
Created January 14, 2016 21:57
Social Curator Zesty.io Example
{{each social_feed as social_item }}
<div class="social-example {{social_item.source}}">
<div class="z-row">
<div class="col-1/3">
<h1>{{social_item.title}}</h1>
<em>Post by {{social_item.username}}</em>
</div>