This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Express = require('express'); | |
const Liana = require('forest-express-sequelize'); | |
const config = require('./config'); | |
const models = require('./models'); | |
const smartCollections = require('./smart-collections'); | |
const app = Express(); | |
const {Schemas} = Liana; | |
// - Hijack Schemas.perform to load Liana collections ourselves |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(jQuery){ | |
var parsedCache = [], | |
_filter = jQuery.filter; | |
jQuery.filter = jQuery.multiFilter = function( expr, elems, not ) { | |
var parsed = [], split, re, matches = [], match, l, i; | |
// We are looking for simple selectors of the form "div", ".class" or "div.class" | |
// We'll try to minimize the extra-processing for complex selectors | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
/* Annoying rule that hides those elements and make it | |
* impossible to retrieve their default display value | |
*/ | |
address, figcaption, mark, ruby { | |
display: none; | |
} | |
</style> | |
<script> | |
// Animate the opacity of the logo to make the address visible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<!-- | |
<== The code that creates the glyph is in script.js | |
--> | |
<head> | |
<meta charset="utf-8" /> | |
<link href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css" rel="stylesheet" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
textarea { | |
width: 100%; | |
height: 300px; | |
margin: 0; | |
padding: 20px; | |
border: 0; | |
border-radius: 0; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HTML inserted before elem in the DOM | |
elem.insertAdjacentHTML( "beforebegin", ... ) | |
// inside elem, before its first child | |
elem.insertAdjacentHTML( "afterbegin", ... ) | |
// inside elem, after its last child | |
elem.insertAdjacentHTML( "beforeend", ... ) | |
// HTML inserted after elem in the DOM | |
elem.insertAdjacentHTML( "afterend", ... ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* margin-top or marginTop? | |
* When to use lower-case and camel-case property names in JavaScript. | |
*/ | |
// Setting style: camel-case | |
elem.style.marginTop = '10px'; | |
// Getting style: camel-case | |
var value = elem.style.marginTop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function( w, d ) { | |
// feature detection | |
if ( w.applicationCache ) { | |
// this script shouldn't run on first load | |
if ( localStorage.hasAppcache === "true" ) { | |
// display a loader and block interaction if an update is available | |
applicationCache.addEventListener("downloading", function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Places from './places.components.jsx'; | |
export default class Example extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = {address: {}}; | |
this.handleChange = this.handleChange.bind(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sequelize = new Sequelize('database', 'username', 'password', { | |
dialect: 'mysql', | |
host: "my.server.tld", | |
port: 9821, | |
}) | |
const Project = sequelize.define('project', { | |
title: Sequelize.STRING, | |
description: Sequelize.TEXT, | |
}); |