Skip to content

Instantly share code, notes, and snippets.

View altfuns's full-sized avatar

Alfonso Aguilar altfuns

  • Rain Bytes
  • Costa Rica
View GitHub Profile
@altfuns
altfuns / designer.html
Created November 23, 2015 22:11
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@altfuns
altfuns / designer.html
Created August 19, 2015 16:27
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@altfuns
altfuns / designer.html
Last active August 29, 2015 14:27
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@altfuns
altfuns / GFormClient.js
Last active August 29, 2015 14:14
Pre-fill Google Form from js
var data = {
customer_code : '32201',
customer_name : 'Abastecedor El Almendro'
};
var formJson = JSON.parse('{\
"title": "Pruba Forms",\
"url": "https://docs.google.com/forms/d/17ocOXlFm9i612mxnzF-Av_rSFS9DaAhawiUuYzGIYAk/viewform",\
"fields": {\
"Email+Address": "27589411",\
@altfuns
altfuns / drupal_ajax_content_type
Created August 3, 2013 23:18
Demostrate how to create a Drupal form with list of content types and the fields of the content types. Use an ajax callback to load the fields of the selected content types. Use the drupal field and node APIs.
/**
* Creates the configuration form for each action.
*/
function hook_content_types_form($form, &$form_state){
$contentTypes = _getContentTypes();
$contentTypeValue = isset($form_state['values']['content_type']) ?
$form_state['values']['content_type']
: key($contentTypes);