Skip to content

Instantly share code, notes, and snippets.

@ondrek
ondrek / tetest
Last active August 29, 2015 14:01
var DomSprite = function(element, properties){
this.properties = properties || {};
this.element = element;
}
goog.inherits(DomSprite, goog.events.EventTarget);
DomSprite.prototype.getAttribute = function(attr){
return this.element.getAttribute(attr);
};
var url = "http://s3.amazonaws.com/api.88x.us/dlQBxMbRwf6RBEcbQw_3pB-xw9Q/blogs";
var body = "";
require("http").get(url, function(res) {
res.on("data", function(chunk) { body += chunk; });
res.on("end", hotovoKonecne);
});
function hotovoKonecne(){
var tuMaBytArray = JSON.parse(body);
idea slovenske basnicky uryvky
@ondrek
ondrek / html.html
Last active August 29, 2015 14:04
testin
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
Ahoj!
</body>
</html>
@ondrek
ondrek / gist:178dd212280de23795fd
Created September 24, 2014 14:44
homepage_layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href='@Url.FrontUrl().FileUrl("favicon.ico")' />
@Html.FrontHtml().Title()
@Html.FrontHtml().Meta()
@Html.FrontHtml().RegisterStyles()
@Html.FrontHtml().RegisterScripts()
<!-- new stylesheet for digicity -->
@ondrek
ondrek / readme-library
Last active August 29, 2015 14:07
DOM manipulations for hackers
Notes:
- very low-level API with simple prototyped-based javascript
- optimised for better readability and performance
- jquery-like simple functions for append, css, remove
(after, append, attr, before, children, clone, css, …)
- supports only 2 latest browsers
(for better support can be added an extension shim)
@ondrek
ondrek / controller-angular.js
Last active August 29, 2015 14:09
Samples for Code Styles
;(function(){
/**
* Recovery Controller provides functionality for:
* (1) resetting password, (2) setting a new one and (3) switching views
*/
'use strict';
@ondrek
ondrek / boilerplate.js
Last active August 29, 2015 14:09
sample of controller boilerplate
;(function(){
/**
* The recovery controller provides functionality for:
* (1) resetting password,
* (2) setting a new one
* (3) and switching between views
*/
@ondrek
ondrek / sleep.js
Created November 26, 2014 14:55
my implementation of "the Sleep FN" in Javascript
var sleep = function(howManyMs){
howManyMs += +new Date(); // add timestamp
while (+new Date()<howManyMs){ ; } // just a NOOP
};
// console:
// > console.log(+new Date(), "hello")
// > sleep(4000);
// > console.log(+new Date(), "world");