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
<section> | |
<h1>Popular Posts</h1> | |
<ul id="popular_posts"> | |
{% for post in site.popular_posts limit: 10 %} | |
<li class="post"> | |
<a href="{{ post.url }}">{{ post.title }}</a> | |
</li> | |
{% endfor %} | |
</ul> | |
</section> |
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
require 'flickraw' | |
def get_views_in_set(photoset_id) | |
FlickRaw.api_key = ENV["FLICKR_KEY"] | |
FlickRaw.shared_secret = ENV["FLICKR_SECRET"] | |
# flickr.photosets.getPhotos | |
# http://www.flickr.com/services/api/flickr.photosets.getPhotos.html | |
# http://www.flickr.com/services/api/explore/flickr.photosets.getPhotos | |
photos = flickr.photosets.getPhotos(:photoset_id => photoset_id, :extras => "views,original_format,path_alias") |
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 | |
// decoder | |
function decodePost($data) | |
{ | |
$lines = explode("\n", $data); | |
$readMeta = true; | |
$post = array(); | |
$body = array(); |
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
cat categories | awk '{count[$0]++}END{for(i in count)print count[i], i}' | sort -nr |
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
#!/bin/sh | |
cmd_pandoc="pandoc -f html -t markdown body.html -o body.md" | |
posts=`ls _posts` | |
root_dir=`pwd` | |
for post in ${posts} | |
do | |
post_dir="_posts/${post}" | |
echo ${post_dir} |
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 | |
$file = './tumblr.xml'; | |
$xml = simplexml_load_file($file); | |
$posts = $xml->posts; | |
$root = "./_posts"; | |
if (!is_dir($root)) { | |
mkdir($root); | |
} |
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 | |
namespace Satooshi; | |
/** | |
* Short description. | |
* | |
* Long description. | |
*/ | |
class Test | |
{ |
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 | |
function run($path) | |
{ | |
$xml = simplexml_load_file($path); | |
foreach ($xml->file as $file) { | |
echo sprintf("file: %s", $file['name']) . PHP_EOL; | |
foreach ($file->error as $violation) { | |
echo " " . printMessage($violation) . PHP_EOL; |
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 | |
function run($path) | |
{ | |
$xml = simplexml_load_file($path); | |
foreach ($xml->file as $file) { | |
echo sprintf("file: %s", $file['name']) . PHP_EOL; | |
foreach ($file->violation as $violation) { | |
echo " " . printMessage($violation) . PHP_EOL; |
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 | |
function run($path) | |
{ | |
$xml = simplexml_load_file($path); | |
$project = $xml->testsuite; | |
echo sprintf("total: %s msec", formatMsec($project['time'])) . PHP_EOL; | |
foreach ($project->testsuite as $testsuite) { |