This file contains hidden or 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
/* Grab Twitter Feed | |
Look at the url of the api that will change to /1.1 from march 2013 | |
callback=twitterCallback2 still works | |
http://twitter.com/statuses/<username>.json? no longer works | |
*/ | |
function init_twitter() { | |
$.getJSON('https://api.twitter.com/1/statuses/user_timeline.json?screen_name='+ twitterID +'&count=1&callback=?&include_rts=true', function(data){ | |
var tweet = data[0]; |
This file contains hidden or 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/python | |
# -*- coding: utf-8 -*- | |
"""[application description here]""" | |
def main(): | |
pass | |
if __name__ == '__main__': main() |
This file contains hidden or 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
<script type="text/javascript" charset="utf-8"> | |
if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1)) { | |
// examples | |
// if you need to add more complex js then of course put this script just above the </body> tag | |
document.location = "http://sassalina.com/iphone/"; | |
document.getElementById("movie").innerHTML="<img src='http://talismangallery.co.uk/wp-content/uploads/2010/04/talisman-gallery-intro.jpg'>"; | |
} | |
</script> |
This file contains hidden or 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
<div id="tabs"> | |
<ul> | |
<li><a href="#tabs-1">Description:</a></li> | |
<li><a href="#tabs-2">Care:</a></li> | |
</ul> | |
<div id="tabs-1"> | |
<p>Usually stemless, the leaves can spread up to 25cm across. Brachycaulos Abdita has an open rosette with beautiful grassy green leaves that curl out from its thick base.In bloom, the leaves turn an absolutely stunning shade of bright pink.They are good rooters too, | |
and send out loads of roots which attaches to its mounting very quickly.</p> | |
<p>*Please bear in mind, each plant is a unique individual with its own quirky character and looks.*</p> | |
</div> |
This file contains hidden or 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
{% for product in collection.products %} | |
<script type="text/javascript"> | |
// preload alternate image | |
if (document.images) { | |
img{{ forloop.index }} = new Image(); | |
img{{ forloop.index }}.src = "{{ product.images.first | product_img_url: 'large' }}"; | |
img{{ forloop.index }}.src = img{{ forloop.index }}.src.replace('_large.','_alt.'); | |
} | |
</script> | |
<div class = "product"> |
This file contains hidden or 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
<div class="pics"><img src="//cdn.shopify.com/s/files/1/0223/3783/files/botanique-home-page-slide-2.jpg?300" /> | |
<img src="//cdn.shopify.com/s/files/1/0223/3783/files/slide2.jpg?302" /> | |
</div> | |
<ul> | |
<li><img src="//cdn.shopify.com/s/files/1/0223/3783/files/home-pic1.jpg?231" /> | |
<h2>A GROWING MOVEMENT</h2> | |
<p>Lovely terrariums that create their own biospheres so that you need not water your houseplants ever again.</p> | |
</li> | |
<li><img src="//cdn.shopify.com/s/files/1/0223/3783/files/home-pic1.jpg?231" /> | |
<h2>THE STATEMENT PIECE</h2> |
This file contains hidden or 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
function randomString(stringLen) { | |
var lowerChars = 'abcdefghijklmnopqrstuvwxyz'; | |
var randomString = ''; | |
for (var i=0; i < stringLen; i++) { | |
var rNum = Math.floor(Math.random() * 25); | |
randomString += lowerChars.charAt(rNum); | |
} | |
return randomString; | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>EthernetBuiltIn</key> | |
<string>Yes</string> | |
<key>GenerateCStates</key> | |
<string>Yes</string> | |
<key>GeneratePStates</key> | |
<string>Yes</string> |
This file contains hidden or 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 | |
//Detect special conditions devices | |
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod"); | |
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone"); | |
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad"); | |
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android"); | |
$webOS = stripos($_SERVER['HTTP_USER_AGENT'],"webOS"); | |
//do something with this information |
This file contains hidden or 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
// challenge description | |
// sample input - | |
// sample output - | |
function coolFunction (input) { | |
var dataStruct = []; // or {} | |
var output = ""; // or 0 | |
dataStruct = input.split(','); | |
output = dataStruct.join(' '); | |
return output; |