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 getQueryVariable(variable) | |
{ | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i=0;i<vars.length;i++) | |
{ | |
var pair = vars[i].split("="); | |
if (pair[0] == variable) | |
{ | |
return pair[1]; |
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
/** | |
* Fifth example, colors meeting at different position | |
*/ | |
background: linear-gradient(45deg, transparent 29.99%, #8b0 40%); | |
background: red; | |
background: linear-gradient(45deg, transparent 25%, #8b0 25%, #8b0 50%, transparent 50%, transparent 75%, #8b0 75%); | |
background-size:100px 100px; |
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
http://www.lukew.com/ff/entry.asp?1699 | |
https://www.gov.uk/design-principles/style-guide | |
https://gds.blog.gov.uk/2014/02/06/improving-gov-uk-on-mobile-devices/ |
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
Bootstrap Resources | |
https://jetstrap.com/ | |
http://www.stylebootstrap.info/ | |
https://wrapbootstrap.com/ | |
http://www.lavishbootstrap.com/ | |
http://www.bootstraphero.com/the-big-badass-list-of-twitter-bootstrap-resources | |
Online editors: | |
http://www.divshot.com/ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
1) Android (till at least 4.3.1), when animating visibility, e.g accordion type movement: | |
.something { | |
height: 0; | |
max-height: 0; | |
opacity: 0; | |
visibility: hidden; | |
transition: visibilty $timing ease-in, opacity $timing ease-in; | |
&.active { |
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
// A component calling a method with parameters; Using ES6, so no need for bind as the arrow function does this | |
<select onChange={(event)=>this._handleSelectChange(x, index, event)} className="form-control" name={"os"+index}> | |
{eachOption} | |
</select> | |
// ES5 way using bind | |
<select onChange={this._handleSelectChange.bind(this,index)} className="form-control" name={"os"+index}> | |
{eachOption} |
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
// Rendering when iterating over an object | |
// proxy/helper function | |
function mapObject(object, callback) { | |
return Object.keys(object).map(function (key) { | |
return callback(key, object[key]); | |
}); | |
} |
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
.disabled { | |
cursor: not-allowed; | |
pointer-events: none; | |
opacity: .65; | |
filter: alpha(opacity=65); | |
box-shadow: none; | |
} |
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
//Write some code, that will flatten an array of arbitrarily nested arrays of //integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
// This solution makes use of .toString() to flatten the array, whereas if the requirements also included flattening object structures, then the typical approach of having a recursing function would be used. | |
var testData = { | |
srcArray1 : [[1,2,[3]],4,[5]], | |
srcArray2 : [[[1],2],[[3]],4], | |
srcArray3 : [0,[1,1],[[2,2,2,2],[[1],[[2]],[[[3],2]]]]], | |
srcArray4 : [1,[2],[[3]],[[[4]]]] | |
}; |
OlderNewer