Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dumindu's full-sized avatar
🌱
One step at a time...

Dumindu Madunuwan dumindu

🌱
One step at a time...
View GitHub Profile
/* Glass effect */
.box {
background: none repeat scroll 0 0 rgba(255, 255, 255, 0.6);
border-radius: 3px;
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
display: block;
margin: 10px 5px;
padding: 20px;
}
@dumindu
dumindu / gist:3359218
Created August 15, 2012 11:14 — forked from acconrad/gist:3350416
How to target mobile devices with CSS Media Queries
@media only screen and (-webkit-device-pixel-ratio: .75) {
/* CSS for Low-density Android screens goes here *
* Ex: HTC Evo, HTC Incredible, Nexus One */
}
@media only screen and (-webkit-device-pixel-ratio: 1) and (max-device-width: 768px) {
/* CSS for Medium-density Android screens goes here *
* Ex: Samsung Ace, Kindle Fire, Macbook Pro *
* max-device-width added so you don't target laptops and desktops */
}
@dumindu
dumindu / Backbone + Handlebars + backbone.layoutmanager
Created November 25, 2012 10:08
Backbone + Handlebars + backbone.layoutmanager
render: function() {
var source = $("#round").html();
var template = Handlebars.compile(source);
var context = JSON.parse(this.model.toJSON);
console.log(context);
var html = template(context);
$(this.el).html(html);
return this;
},
├── Cargo.toml
└── src
└── lib.rs
├── Cargo.toml
└── src
└── main.rs
@dumindu
dumindu / uri.js
Last active October 26, 2015 06:51 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
// Line comments
/* Block comments */
/// Line comments; document the next item
/** Block comments; document the next item */
//! Line comments; document the enclosing item
/*! Block comments; document the enclosing item !*/
/// Foo
#[doc="Foo"]
//! Foo
#![doc="Foo"]
$isCron = 'cli' === strtolower(PHP_SAPI);