Skip to content

Instantly share code, notes, and snippets.

[
{
"name": "users",
"label": "Users",
"fields": [
{
"name": "name",
"label": "User Name",
"type": "text",
"required": true
$users = new Collection('users', 'Users', [
new TextField('name', 'Name'),
new PasswordField('password', 'Password'),
new CheckboxField('role', 'Role', ['guest'=>'Guest', 'admin'=>'Admin']),
], ['admin']);
$tags = new Collection('tags', 'Tags', [
new TextField('label', 'Label'),
new EntryField('author', 'Author'),
]);
@jmas
jmas / tip.css
Created February 5, 2016 09:01
CSS3 tooltips
/**
* CSS3 tooltips.
* @link: http://jsfiddle.net/2am9gx72/5/
* @example:
* <span data-tip="Information tooltip" tabindex="-1">info</span>
*/
.tip, .tip-static, [data-tip]:before {
width: 300px;
padding: 10px;
content: attr(data-tip);
@jmas
jmas / app.scss
Last active February 7, 2016 08:51
@import "foundation";
@include foundation-global-styles;
@include foundation-grid;
@include foundation-typography;
import EntryUser from './cmp/entry-user';
import DatetimeInput from './cmp/ui/datetime-input';
new Vue({
el: '#event-form',
components: {
EntryUser,
DatetimeInput
},
data: {
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
//csso = require('gulp-csso'),
//uglify = require('gulp-uglify'),
jade = require('gulp-jade'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'), // Livereload plugin needed: https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
tinylr = require('tiny-lr'),
express = require('express'),

Do not use ID attributes in CSS

  • Use .class instead
  • ID used to identify element
  • ID can use only once per page
  • If we use ID to style element - we write styles for one element, but better if we use selector by class .class to write more flexible styles
😡 😄
Add Add
@jmas
jmas / ga-endpoints.md
Last active April 6, 2016 11:41
SM: GA Endpoints

Auth in GA

  1. Open link /seo-tools/admin/google-analytics/api/auth in child window
  2. 301 Redirect to GA OAuth service with Callback URL /seo-tools/admin/google-analytics/api/auth/callback
  3. Authed in GA service and redirected to Callback URL
  4. Callback URL page make JS call to parent window to switch UI into authed mode

Attribute data-auth-state=[true|false] attached to .js-react-container is a flag that indicate authed state.

Summary

(function($) {
"use strict";
/**
* @param containerEl
* @param directoriesUrl
* @param listingUrl
* @param country
* @param itemTemplate
* @constructor

/

Start

REQUEST: POST /?moduleId=<STRING>

action=start
rate=<INT>