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
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
<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
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title><![CDATA[{{ site.title }}]]></title> | |
<link href="{{ site.url }}/atom.xml" rel="self"/> | |
<link href="{{ site.url }}/"/> | |
{% if site.hub_url %}<link href="{{ site.hub_url }}" rel="hub"/>{% endif %} | |
<updated>{{ site.time | date_to_xmlschema }}</updated> | |
<id>{{ site.url }}/</id> | |
<author> |
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
desc "notify to PuSH Hub server" | |
task :pubsub do | |
require 'net/http' | |
require 'uri' | |
hub_url = "http://satooshi.superfeedr.com" # <--- replace this with your hub | |
atom_url = "http://blog.satooshi.jp/atom.xml" # <--- replace this with your full feed url | |
resp, data = Net::HTTP.post_form(URI.parse(hub_url), | |
{'hub.mode' => 'publish', | |
'hub.url' => atom_url}) |
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/env bash | |
# PHP.next Development releases depend on current XDebug development | |
# snapshots. | |
function install_twig_master { | |
local source_dir="$TMP/source/twig-master" | |
local cwd=$(pwd) | |
local revision=$1 | |
if [ -d "$source_dir" ] && [ -d "$source_dir/.git" ]; then |
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 | |
// data | |
/** | |
* Data represents "source_files" element of Coveralls' "json_file". | |
* | |
* @author Kitamura Satoshi <[email protected]> | |
*/ | |
class SourceFile |
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
# workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.php.ui.prefs | |
eclipse.preferences.version=1 | |
cleanup.remove_trailing_whitespaces_all=true | |
cleanup.remove_trailing_whitespaces=true | |
cleanup.remove_trailing_whitespaces_ignore_empty=false | |
editorColorPhpdoc=\#e10071 | | true | false | false | false | |
editorColorKeyword=\#0000a0 | null | true | false | false | false | |
editorColorString=\#004000 | null | false | false | false | false |
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
sf2-ddd | |
├── app | |
├── bin | |
├── build | |
├── lib | |
├── src | |
│ └── __VendorPrefix | |
│ ├── Application | |
│ │ └── __DomainNameBundle | |
│ │ ├── Command |
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 | |
$time = '03/2014'; | |
$dt1 = \DateTime::createFromFormat('m/Y', $time); // "2014-03-19 17:14:38" | |
$dt2 = \DateTime::createFromFormat('!m/Y', $time); // "2014-03-01 00:00:00" | |
$dt3 = \DateTime::createFromFormat('m/Y!', $time); // "1970-01-01 00:00:00" | |
$dt4 = \DateTime::createFromFormat('m!/Y', $time); // "2014-01-01 00:00:00" | |
var_dump($dt1, $dt2, $dt3, $dt4); | |
/* |