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, { Component } from 'react' | |
import { bool, object } from 'prop-types' | |
class StateProvides extends Component { | |
state = { | |
state: {}, | |
hydrated: false, | |
} |
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
<div ng-app="myApp"> | |
<ul ng-controller="myCtrl"> | |
<li ng-repeat="item in items | contains:'id':showList">{{ item.title }}</li> | |
<!-- | |
now instead of showing all items, it will only show list items with the id of 2 or 4 like below: | |
<li>two</li> | |
<li>four</li> | |
--> | |
</ul> |
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 () { | |
var root = $(document.getElementsByTagName('body')); | |
var watchers = []; | |
var f = function (element) { | |
if (element.data().hasOwnProperty('$scope')) { | |
angular.forEach(element.data().$scope.$$watchers, function (watcher) { | |
watchers.push(watcher); | |
}); | |
} |
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
/** | |
* Assign or Create Angular Module | |
* | |
* The purpose of this is to first get the module if it exists, if not then create it | |
*/ | |
// NO WORK | |
var myTestModule = angular.module('myTestModule') || angular.module('myTestModule', []); | |
// WORKS - with the registeredModules.js file |
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
var s = document.createElement('script'); | |
s.setAttribute('type', 'text/javascript'); | |
s.setAttribute('src', 'script.js'); | |
document.getElementsByTagName('body')[0].appendChild(s); |
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
// Creating a fake model called Unit | |
(function (angular) { | |
'use strict'; | |
// Unit Model Construtor | |
function Unit (futureUnitData) { | |
// Data is immediately available | |
if (! futureUnitData.inspect) { | |
// not sure if this is underscore, LoDash or something with angular | |
// need to research |
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
/* From Modernizr */ | |
function whichTransitionEvent () { | |
var t, | |
el = document.createElement('fakeelement'), | |
transitions = { | |
'transition': 'transitionend', | |
'OTransition': 'oTransitionEnd', | |
'MozTransition': 'transitionend', | |
'WebkitTransition': 'webkitTransitionEnd' | |
}; |
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
<?php | |
function color_brightness($hex, $percent) { | |
// Work out if hash given | |
$hash = ''; | |
if (stristr($hex,'#')) { | |
$hex = str_replace('#','',$hex); | |
$hash = '#'; | |
} |
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
// previous code condenced to make sense of code | |
this.slides = $('.slides'); | |
// loop through each slide with a delay to slide in | |
_.each(this.slides, function (v, k) { | |
// slide in slide | |
$(this.slides[k]).delay(200 * k).animate({ | |
top: '0px', | |
opacity: 1 | |
}, 800); |
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
Font stacks based on system fonts | |
--------------------------------- | |
Times New Roman stack | |
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; | |
Georgia stack: | |
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, Palatino, Palatino Linotype, Times, Times New Roman, serif; | |
Garamond stack |
NewerOlder