Skip to content

Instantly share code, notes, and snippets.

View acf_repeater_output_oxygen_reusable_part.php
<?php
// 13: Post ID of the page the repeater is located on
if( have_rows('questions_and_answers', 13) ):
// loop through the rows of data
while ( have_rows('questions_and_answers', 13) ) : the_row();
// display a sub field value
//193: Post ID of reusable part template
@bytesource
bytesource / tweetclone_sequel.rb
Created Nov 19, 2012
"Tweetclone" Twitter clone using Sequel (database schema taken from "Cloning Internet Applications with Ruby")
View tweetclone_sequel.rb
# CREATE DATABASE tweetclone WITH ENCODING 'UTF-8'
require 'sequel'
require 'logger'
# CONNECTION ================================
DB = Sequel.connect(ENV['DATABASE_URL'] ||'postgres://postgres:password@localhost/tweetclone')
# Logging SQL Queries
DB.loggers << Logger.new($stdout)
View group_by_date_problem.rb
# Sequel Google Groups
# Topic: https://groups.google.com/forum/?fromgroups#!topic/sequel-talk/WlgsyLtd9eE
require 'sequel'
require 'logger'
require 'date'
# Connection
# =============
@bytesource
bytesource / csv_parser_csv_gem_benchmark.rb
Created Sep 4, 2011
Simple CSV Parser vs. CSV Gem Benchmark
View csv_parser_csv_gem_benchmark.rb
require 'open-uri'
require 'nokogiri'
require 'parslet'
require 'csv'
# --------------------------------------------------
# Auxiliary code
class String