Skip to content

Instantly share code, notes, and snippets.

Avatar

Thanos Polychronakis thanpolas

View GitHub Profile
@thanpolas
thanpolas / invocator.js
Created Sep 21, 2012
Get a new instance of an Object (class) that's invocable - binded to a specific method
View invocator.js
/**
* The invocator function creates a new instance of the provided constructor
* which is also linked to a method that it contains.
*
* Check this fiddle for a live example: http://jsfiddle.net/thanpolas/Aky9Y/7/
*
* Invocator only works for pseudo-classical type of classes (prototypical).
*
* Requires 'bind' and 'isFunction', currently use underscore's equivalents.
*
@thanpolas
thanpolas / gist:4153379
Created Nov 27, 2012
Google Closure events wiring
View gist:4153379
myApp.Event = function(){};
goog.inherits(myApp.Event, goog.events.Event);
// --- in another file --- //
myApp.ClassOne = function(){
goog.base(this);
@thanpolas
thanpolas / dabblet.css
Created Dec 10, 2012
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
.envelope {
font-size: 650%;
font-family: Courier;
}
View dabblet.css
.codeblock {
width: 600px;
height: 200px;
background-color: yellow;
display: block;
}
.lineno {
background-color: #ddd;
width: 60px;
}
View dabblet.css
.container {
width: 100%;
}
.col1 {
width: 200px;
float: left;
margin-left: 20px;
background-color: #ddd;
}
View dabblet.css
.container {
width: 100%;
}
.col1 {
width: 200px;
float: left;
margin-left: 20px;
background-color: #ddd;
}
View dabblet.css
.container > p:last-child {
background-color: yellow;
}
View dabblet.css
.container > p {
background-color: yellow;
min-height: 150px;
box-shadow: inset 0 5px 10px 1px rgba(0, 0, 0, 0.45), 0 5px 10px 1px rgba(0, 0, 0, 0.25);
}
View dabblet.css
header {
width: 100%;
height: 200px;
background-color: red;
margin: 0;
display:block;
}
header div {
margin-top:50px;
View dabblet.css
body {
background: blue;
padding:0;
}
header {
height: 200px;
background-color: red;
margin: 0;
display:block;
overflow: hidden;