Skip to content

Instantly share code, notes, and snippets.

View adamsilver's full-sized avatar

Adam Silver adamsilver

View GitHub Profile
@adamsilver
adamsilver / fonts.css
Created March 26, 2016 09:12
CSS custom font declaration
/**********************************************************
* Droid sans
**********************************************************/
@font-face {
font-family: 'droid sans';
src: url('../fonts/DroidSans-webfont.eot');
src: url('../fonts/DroidSans-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/DroidSans-webfont.woff') format('woff'),
url('../fonts/DroidSans-webfont.ttf') format('truetype'),
<!-- _errorMessagePanel.cshtml -->
<!--
1. this combining is necessary so that we don't have two messages on screen at once when js kicks in
2. The error div is always there incase JS needs to utilise it but sometimes adds class of hide when there are no messages to display
-->
<div id="errorMessagePanel" class="if(Model.errorMessage == null) { hide }">
if(Model.errorMessage.standardError != null) {
<p>@Model.errorMessage.standardError.text</p>
@adamsilver
adamsilver / checkboxes.html
Last active August 29, 2015 14:26
forms for the kids
<div class="groupControl">
<div class="indicator">Favourite things</div>
<fieldset>
<legend>Gender</legend>
<div class="control firstControl">
<input type="checkbox" class="checkbox" value="male" name="thing" id="thing">
<label for="thing">Thing</label>
</div>
<div class="control">
<input type="checkbox" class="checkbox" value="female" name="thing" id="thing1">
@adamsilver
adamsilver / gist:dcee5ea20e20ee824dab
Last active August 29, 2015 14:23
View Model - Trial Barrier
{
trialBarrier: {
signInLink: "href goes here",
packages: {
premium: {
name: "",
imageSrc: "",
subscribeLink: "",
price: {
annual: "&#163;7.35",
'use strict';
var Delegate = require('dom-delegate');
function getNotificationHtml(message) {
return message;
}
module.exports = {
init: function () {
return;
@adamsilver
adamsilver / gist:d42a67c1b29fcbdda125
Last active August 29, 2015 14:21
View Models, Views, Partials, Handlebars, Next

View, Partial, View Model design discussion

Why I am sending you this?

I believe we can be more consistent and formulate a better separation of concerns which in-turn leads to better maintainability and testability. Below I have designed what I believe to be an ideal design/split for a slice of functionality on the Next Platform but is applicable across the rest of Next. Would like to discuss this with you but wanted to get some of it down on paper as I think it's easier that way.

View

Taking the premium barrier as an example:

<script>
/*!
* @preserve
* jquery.scrolldepth.js | v0.4.1
* Copyright (c) 2014 Rob Flaherty (@robflaherty)
* Licensed under the MIT and GPL licenses.
*/
;(function ( $, window, document, undefined ) {
"use strict";
prompt: Is this ok?: (yes) yes
info: Creating snapshot 0.0.1-21
info: Uploading: [=============================] 100%
error: Error running command deploy
error: Nodejitsu Error (401): Not Authorized
help: For help with this error contact Nodejitsu Support:
help: webchat: <http://webchat.nodejitsu.com/>
help: irc: <irc://chat.freenode.net/#nodejitsu>
help: email: <[email protected]>
help:
{
"name": "Proto",
"version": "0.0.1-12",
"author": "A Silver",
"contributors": [
{
"name": "A Silver",
"email": "[email protected]"
}
],
JEUKFPHMAC1707:proto adam.b.silver$ jitsu deploy --debug
info: Welcome to Nodejitsu adam.b.silver
info: jitsu v0.13.15, node v0.10.26
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in node src/app/app.js
debug: { method: 'GET',
debug: uri: 'https://api.nodejitsu.com/apps/adam.b.silver/Proto',
debug: headers:
debug: { Authorization: '*************************************************************************',