Skip to content

Instantly share code, notes, and snippets.

View simevidas's full-sized avatar
🦊
sticking with Firefox till the end

Šime Vidas simevidas

🦊
sticking with Firefox till the end
View GitHub Profile

Articles about flexbox:

<head>
<script>document.write('<meta charset="utf-8">')</script>
</head>
<body>
<script>
document.body.innerHTML += "✓";
</script>
</body>
@simevidas
simevidas / gist:6612409
Last active December 23, 2015 09:09
Poll: Code blocks in blog posts
// Page 3
document.addEventListener('DOMContentLoaded', function init() {
var testD = document.querySelector('#testDetails');
var summary = testD.querySelector('summary');
summary.addEventListener('click', function () {
var open = !testD.hasAttribute('open');
console.log(open);
@simevidas
simevidas / gist:6708899
Last active December 23, 2015 23:19 — forked from miketaylr/gist:6701828
<script>
if (screen.width <= 640) document.write('<meta name="viewport" content="width=device-width, initial-scale=1">');
</script>
<script>
(function () {
google.maps.event.addDomListener(window, 'load', init);
var map;
function init() {
var mapOptions = {
center: new google.maps.LatLng(45.8167,15.9833),
zoom: 2,
<!doctype html>
<html>
<head>
<title>Tabs Demo!</title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
.container {
margin-top: 20px;
}
@simevidas
simevidas / gist:8272443
Last active January 2, 2016 07:49
Creating the MongoDB URL in a Node web app on AppFog
// This is my refactored version of the code available in AppFog’s documentation here:
// https://docs.appfog.com/services/mongodb#node
// The version string is passed to the IIFE as an argument ('mongodb2-2.4.8' in my case)
var mongourl = (function (mongo_version) {
var VCAP = process.env.VCAP_SERVICES;
var obj = VCAP ? JSON.parse(VCAP)[mongo_version][0].credentials : {};
return [
"Exception caught during observer callback: @data:text/javascript;base64,CiAgICBQb2x5bWVyKCdwb2x5bWVyLXNlbGVjdG9yJywgewogICAgICAvKioKICAgICAgICogR2V0cyBvciBzZXRzIHRoZSBzZWxlY3RlZCBlbGVtZW50LiAgRGVmYXVsdCB0byB1c2UgdGhlIGluZGV4CiAgICAgICAqIG9mIHRoZSBpdGVtIGVsZW1lbnQuCiAgICAgICAqCiAgICAgICAqIElmIHlvdSB3YW50IGEgc3BlY2lmaWMgYXR0cmlidXRlIHZhbHVlIG9mIHRoZSBlbGVtZW50IHRvIGJlCiAgICAgICAqIHVzZWQgaW5zdGVhZCBvZiBpbmRleCwgc2V0ICJ2YWx1ZWF0dHIiIHRvIHRoYXQgYXR0cmlidXRlIG5hbWUuCiAgICAgICAqCiAgICAgICAqIEV4YW1wbGU6CiAgICAgICAqCiAgICAgICAqICAgICA8cG9seW1lci1zZWxlY3RvciB2YWx1ZWF0dHI9ImxhYmVsIiBzZWxlY3RlZD0iZm9vIj4KICAgICAgICogICAgICAgPGRpdiBsYWJlbD0iZm9vIj48L2Rpdj4KICAgICAgICogICAgICAgPGRpdiBsYWJlbD0iYmFyIj48L2Rpdj4KICAgICAgICogICAgICAgPGRpdiBsYWJlbD0iem90Ij48L2Rpdj4KICAgICAgICogICAgIDwvcG9seW1lci1zZWxlY3Rvcj4KICAgICAgICoKICAgICAgICogSW4gbXVsdGktc2VsZWN0aW9uIHRoaXMgc2hvdWxkIGJlIGFuIGFycmF5IG9mIHZhbHVlcy4KICAgICAgICoKICAgICAgICogRXhhbXBsZToKICAgICAgICoKICAgICAgICogICAgIDxwb2x5bWVyLXNlbGVjdG9yIGlkPSJzZWxlY3RvciIgdmFsdWVhdHRyPSJsYWJ
// Hey! Listen!
// The above slide animation is transition:flex.
// No hard-coded px/% width values!
@media (min-width: 800px)
.services
display flex
.services__item
flex 1
transition flex .25s ease-in-out .1s