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
class ItemsViewController < UIViewController | |
attr_accessor :database, :user_id, :data_source | |
def viewDidLoad | |
super | |
navigationItem.title = "Items" | |
@items_table = UITableView.alloc.initWithFrame(view.bounds) | |
@items_table.delegate = self | |
@data_source = CBLUITableSource.alloc.init |
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 "Blocks.h" | |
#import <CouchbaseLite/CouchbaseLite.h> | |
@implementation Blocks | |
+(void)setupListsMapBlockForView:(CBLView*)view | |
{ | |
if (!view.mapBlock) { | |
[view setMapBlock: MAPBLOCK({ | |
if ([doc[@"type"] isEqualToString:@"list"]) |
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
Show hidden characters
{ | |
"-W025": false | |
} |
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
var cb = require("couchbase") | |
var async = require("async") | |
var cluster = new cb.Cluster("couchbase://localhost/") | |
var bucket = cluster.openBucket("default") | |
bucket.queryhosts = ["localhost:8093"] | |
var log = function () { | |
var args = Array.prototype.slice.call(arguments, 0) | |
console.log.apply(null, args.filter(function (e) { return e != null })) |
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
var couchbase = require("couchbase") | |
var async = require("async") | |
var bucket = new couchbase.Connection({}) | |
function die(msg) { | |
if(msg) console.log(msg) | |
bucket.shutdown() | |
process.exit() | |
} |
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
[cberl:set(default, list_to_binary(X), 0, {[{<<"type">>,<<"bar">>}]}) || X <- [lists:flatten(io_lib:format("bar-~p", [X])) || X <- lists:seq(4, 10000)]]. |
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
#!/bin/bash | |
# Output is a script which installs all currently installed packages from | |
# homebrew, including those from tabs. Packages no longer available are ignored | |
# Usage: | |
# ./backup-homebrew.sh > my-homebrew-backup.sh | |
# | |
# warnings about packages not available anymore will be generated | |
# |
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
/** | |
* Functions to handle transition from Tumblr to Wordpress | |
* author: philipp fehre <philipp@fehre.co.uk | |
* | |
* The goal ist to make imported tumbler posts work along the normal permalinks | |
* generated by tumblr | |
* | |
* This works for posts imported via http://tumblr2wordpress.benapps.net | |
* exported file containing the tumblr post ids in the post_name field. | |
*/ |
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
require "dotenv/tasks" | |
require "uri" | |
namespace :development do | |
desc "run server" | |
task :server => :dotenv do | |
sh "php -S localhost:9292 " | |
end | |
desc "open a local database shell" |
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
if (null !== getenv("DATABASE_URL")) { | |
$db = parse_url(getenv("DATABASE_URL")); | |
define("DB_NAME", trim($db["path"],"/")); | |
define("DB_USER", $db["user"]); | |
define("DB_PASSWORD", $db["pass"]); | |
define("DB_HOST", $db["host"]); | |
define('DB_CHARSET', 'utf8'); | |
define('DB_COLLATE', ''); | |
} else { | |
die("Your heroku DATABASE_URL does not appear to be correctly specified."); |