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
<style> | |
.tabs { border-bottom: 1px solid #d4d4d4; padding-left: 0; } | |
.tabs a { background: #eee; border: 1px solid #d4d4d4; color: #6a6a6a; display: block; float: left; line-height: 36px; margin-bottom: -1px; padding: 0 10px; text-decoration: none; } | |
.tabs li { list-style: none; } | |
.tabs .active { background: #fff; border-bottom: 0; color: #2c2c2c; font-weight: 700; padding-bottom: 1px; } | |
.hide { display: none; } | |
.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; } | |
.clearfix:after { clear: both; } | |
.clearfix { zoom: 1; } | |
</style> |
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 | |
$json_url = 'ona12.json'; | |
$json_string = file_get_contents($json_url); | |
$json_decoded = json_decode($json_string, true); | |
$items = $json_decoded; | |
$items_random = shuffle($items); | |
$i = 1; | |
echo '<h1>ONA12 sessions sorted randomly</h1>'; | |
echo '<a class="large button nice" href="http://www.reddit.com/r/digitaljournalism">Full list</a>'; | |
echo '<ul>'; |
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
import requests | |
images = ['http://url.to/image.jpg', 'http://url.to/image.jpg'] | |
def get_photos(): | |
# Iterates through the list of images | |
for image in images: | |
# Gets the image from the url |
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
from datetime import * | |
from dateutil.rrule import * | |
from dateutil.relativedelta import * | |
def get_friday_the_13s(): | |
YEARS_AGO = 100 | |
TODAY = date.today() | |
YEARSAGO = TODAY + relativedelta(years=-YEARS_AGO) | |
fridays = list(rrule(DAILY, byweekday=(FR), dtstart=YEARSAGO, until=TODAY)) | |
friday13s = list(rrule(DAILY, bymonthday=13, byweekday=(FR), dtstart=YEARSAGO, until=TODAY)) |
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
import json | |
import requests | |
def get_twitter_favorites(): | |
# SET UP VARIABLES | |
SCREEN_NAME = 'yurivictor' # Please change this | |
BASE_URL = "https://api.twitter.com/1/favorites.json?screen_name=" | |
URL = BASE_URL + SCREEN_NAME | |
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 | |
function iOSDetect() { | |
$browser = strtolower( $_SERVER['HTTP_USER_AGENT'] ); | |
if( strstr( $browser, 'iphone' ) || strstr( $browser, 'ipod' ) ) | |
$device = 'iphone'; | |
return( $device ); | |
} | |
iOSDetect(); |
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
<style> | |
.tab-menu { border-bottom: 1px solid #eee; padding: 0; } | |
.tab-menu:before, | |
.tab-menu:after { content: "\0020"; display: block; height: 0; overflow: hidden; } | |
.tab-menu:after { clear: both; } | |
.tab-menu li { float: left; list-style: none; } | |
.tab-menu li a { background: #fff; border: 1px solid #eee; border-bottom: 0; display: block; padding: 10px; } | |
.tab-menu .selected { margin-bottom: -1px; padding-bottom: 11px; } | |
.tab-item { clear: left; display: none; } | |
.tab-item-selected { display: block; } |
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
(function ($) { | |
// SETS UP RIGHT/LEFT ARROW PAGINGATION | |
// Key 39 is the right arrow | |
// Key 37 is the left arrow | |
$('body').keyup(function (event) | |
{ | |
if (event.keyCode == 39) | |
{ | |
window.open('next-page-url','_self'); | |
} |
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
import requests | |
def get_photos(): | |
RANGE_TOP = 1 | |
RANGE_BOTTOM = 500000000 | |
# Iterates through the list of images | |
for i in range(RANGE_TOP, RANGE_BOTTOM): |
OlderNewer