Skip to content

Instantly share code, notes, and snippets.

@MrMaksimize
MrMaksimize / gist:1012364
Created June 7, 2011 14:31
SugarSkull router on Leave
apciMobile.Router = Router({
'/login': function () {
new apciMobile.loginPageView({
el: $('#content')
});
},
'/home': function(){
var gridView = new apciMobile.gridView({
el: $('#content'),
collection: apciMobile.grid
@MrMaksimize
MrMaksimize / gist:1089616
Created July 18, 2011 14:09
rough idea of return definition
'return' => array(
'type' => 'array',
'schema' => array(
'gid' => array(
'gid' => 'int',
'title' => 'string',
'descripion' => 'string',
'logo' => 'string',
'readioactivity' => 'int',
'uri' => 'string'
@MrMaksimize
MrMaksimize / gist:1159668
Created August 20, 2011 21:07
Event Layout
$handler = new stdClass;
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'node_view_panel_context';
$handler->task = 'node_view';
$handler->subtask = '';
$handler->handler = 'panel_context';
$handler->weight = 0;
$handler->conf = array(
'title' => 'Events',
<div class="col1" style="float:left; width:300px">
content on the left side here
</div>
<div class="col2" style="float:left; width:300px">
content on the right here
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="
Notice: Undefined variable: language in /vagrant/public/allplayers/www/sites/all/themes/allplayers960/maintenance-page.tpl.php on line 19
Call Stack:
0.0002 645216 1. {main}() /vagrant/public/allplayers/www/index.php:0
27.6490 96956328 2. menu_execute_active_handler() /vagrant/public/allplayers/www/index.php:17
54.7283 203645640 3. call_user_func_array() /vagrant/public/allplayers/www/includes/menu.inc:349
54.7284 203646384 4. services_endpoint_callback() /vagrant/public/allplayers/www/includes/menu.inc:349
@MrMaksimize
MrMaksimize / gist:1264539
Created October 5, 2011 14:19
Latest Vagrant error
devel downloaded from [ok]
http://ftp.drupal.org/files/projects/devel-7.x-1.2.tar.gz.
views_bulk_operations downloaded from [ok]
http://ftp.drupal.org/files/projects/views_bulk_operations-7.x-3.0-beta2.tar.gz.
views downloaded from [ok]
http://ftp.drupal.org/files/projects/views-7.x-3.0-rc1.tar.gz.
features downloaded from [ok]
http://ftp.drupal.org/files/projects/features-7.x-1.0-beta4.tar.gz.
diff downloaded from [ok]
http://ftp.drupal.org/files/projects/diff-7.x-2.0.tar.gz.
@MrMaksimize
MrMaksimize / gist:1264664
Created October 5, 2011 15:06
phpunit chef
# Author:: Mark Sonnabaum <mark.sonnabaum@acquia.com>
# Modifying Author:: Maksim Pecherskiy <max@allplayers.com>
# Recipe:: phpunit
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@MrMaksimize
MrMaksimize / gist:1266405
Created October 6, 2011 03:06
mobile meta tags
<meta name="description" content="">
<meta name="author" content="">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/h/apple-touch-icon.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/m/apple-touch-icon.png">
<link rel="apple-touch-icon-precomposed" href="img/l/apple-touch-icon-precomposed.png">
<link rel="shortcut icon" href="img/l/apple-touch-icon.png">
@MrMaksimize
MrMaksimize / gist:1275195
Created October 10, 2011 12:35
vagrant error
[default] [Mon, 10 Oct 2011 05:33:55 -0700] INFO: Processing bash[install-drush] action run (drush::default line 20)
: stdout
[default] Forcing shutdown of VM...
[default] Destroying VM and associated drives...
/Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:33:in `select': closed stream (IOError)
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:33:in `io_select'
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:32:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:32:in `io_select'
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/packet_stream.rb:73:in `available_for_read?'
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/packet_stream.rb:85:in `next_packet'
@MrMaksimize
MrMaksimize / gist:1318466
Created October 27, 2011 00:47
proposal

#Oh the things you can do… with an API!

Most successful companies on the web today from Amazon to Dropbox to Google to Twitter expose some kind of API to their users to write their own applications and interact with their application programmatically. They expose an even deeper API for their internal teams.

Even Dries recognizes the importance of being able to output data in different formats and now Drupal has an awesome Web Services and Context Core Initiative

With Drupal, your site doesn't have to be big, or small, or even cool to have an API. It just has to be running Drupal! (So by definition it would be cool anyways).

In this session we'll delve into a discussion of APIs built using the Services Module. We'll talk about how internal APIs can be leveraged to transform your website into an SOA application and how external APIs can bring more adoption a