Skip to content

Instantly share code, notes, and snippets.

View mrdanadams's full-sized avatar

Dan Adams mrdanadams

  • Ground Signal
  • Boston, MA
View GitHub Profile
@mrdanadams
mrdanadams / manifest.xml
Created July 29, 2011 13:51
Brightcove App Cloud manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<template>
<name>ClosePhoto</name>
<description>Browse photos taken near you</description>
<devices>
<device name='iPhone'></device>
<device name='Android'></device>
</devices>
<views>
<view>
@mrdanadams
mrdanadams / home.html
Created July 29, 2011 13:58
Brightcove App Cloud basic template
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="user-scalable=no, width=device-width, minimum-scale=1, maximum-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>Home</title>
@mrdanadams
mrdanadams / app.js
Created July 29, 2011 14:16
Brightcove App Cloud app js
var app = {};
// The Brightcove API provides an "init" event in addition to the normal jQuery load event
$(bc).bind("init", function () {
var wrappedFetch = bc.device.fetchContentsOfURL;
// We can detect if we are on-device or in-browser to make life easier for ourselves
if (!bc.device.isNative()) {
bc.device.fetchContentsOfURL = function(url, success, error) {
// note: start chrome with --disable-web-security to disable cross-domain protection
@mrdanadams
mrdanadams / app.css
Created July 29, 2011 14:22
Brightcove App Cloud app css
body {margin: 0}
/* gallery and image detail styles */
#photos .thumb {float: left; background-position: center; background-repeat: no-repeat; overflow: hidden;}
#imageInfo { position: absolute; bottom: 0px; padding: 10px 5px; width: 100%; color: white; background-color: #292927; border-top: 1px dashed #4B4B4A; }
#imageInfo .close { float: right; display: block; margin-right: 10px; margin-top: -5px; font-size: 10px; }
#imageInfo h1 { font-size: 95%; }
#imageInfo h2 { font-size: 80%; font-weight: normal; }
#imageInfo h3 { font-size: 70%; font-weight: normal; }
@mrdanadams
mrdanadams / examples.scala
Created August 3, 2011 16:36
Scala Language Examples
/*
* var vs val and defining variables
*/
var changeMe = 1 // variable assignment
val dontChangeMe = 2 // constant assignment
changeMe = 3
assert(changeMe == 3)
// this causes the error: reassignment to val
@mrdanadams
mrdanadams / media.css
Created November 22, 2011 20:25
Fluid grids and responsive design with wordpress
@media screen and (max-width: 650px) {
#container, #aside-container, #blog-title, #access { display: block; float: none; width: auto; margin: 0 3% 3% 3%; }
body { font-size: 14px; line-height: 16px; }
}
@mrdanadams
mrdanadams / config.rb
Created November 22, 2011 20:37
Sass and Compass with WordPress
http_path = "/"
css_dir = "."
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "scripts"
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
# To enable relative paths to assets via compass helper functions.
@mrdanadams
mrdanadams / create_origin.sh
Created November 22, 2011 20:48
Private github repos
$ cd git
$ mkdir yourproject.git
$ cd yourproject.git
$ git --bare init
@mrdanadams
mrdanadams / apache.conf
Created November 22, 2011 21:10
VirtualBox on Mac
<VirtualHost *:80>
#...
DocumentRoot /var/www/yoursite
Options FollowSymLinks
<Directory />
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
<Directory /var/www/yoursite>
@mrdanadams
mrdanadams / comment_filter.php
Created November 22, 2011 21:18
Wordpress comment bubbles in CSS
// indicate if a post has comments or not
// note: $c is an array of strings
function childtheme_filter_post_class($c) {
$c[] = get_comments_number() > 0 ? 'has-comments' : 'no-comments';
return $c;
}
add_filter('post_class', 'childtheme_filter_post_class', 10, 1);