Skip to content

Instantly share code, notes, and snippets.

View arozwalak's full-sized avatar

Artur Rozwalak arozwalak

View GitHub Profile
@arozwalak
arozwalak / index.html
Created November 26, 2013 19:58
CSS: wysiwyg
<p>TEST #1 formatowanie tekstu</p>
<p>Lorem ipsum dolor sit amet, <span style="text-decoration: line-through;">consectetuer adipiscing elit,</span> sed diam nonummy nibh euismod tincidunt <strong>ut laoreet dolore</strong> magna aliquam <em>erat volutpat</em>. Ut wisi enim ad minim veniam, <span style="text-decoration: underline;">quis nostrud exerci</span> tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. <strong>Duis autem vel eum iriure dolor</strong> in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu <span style="color: #ff0000;">ta czcionka jest kolorem czerwonym pisana</span> feugiat nulla facilisis <em>at vero eros et accumsan et </em>iusto odio <span style="text-decoration: underline;">dignissim qui</span> blandit praesent luptatum <span style="background-color: #ffff00;">to powinno mieć ż&oacute;łte tło</span> zzril delenit augue duis dolore te feugait nulla facilisi.</p>
<p>TEST #2 ukierunkowanie tekstu</p>
<p style="text-align: left;">Tekst do l
@arozwalak
arozwalak / style.css
Last active December 29, 2015 11:49
CSS3: Background gradient
selector {
background: #e0e0e0; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 1%, #e0e0e0 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#ffffff), color-stop(100%,#e0e0e0)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 1%,#e0e0e0 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 1%,#e0e0e0 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 1%,#e0e0e0 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 1%,#e0e0e0 100%); /* W3C */
}
@arozwalak
arozwalak / index.html
Created November 27, 2013 10:22
HTML5: Example
<!doctype html>
<html lang="en">
<head>
<title>The Flower Blog</title>
</head>
<body>
<header>
<h1>The Flower Blog</h1>
</header>
<nav>
@arozwalak
arozwalak / createHTML5Elements.js
Created November 27, 2013 10:24
HTML5: Example2
/*
* Create HTML5 elements for IE's sake
* Reference: http://ejohn.org/blog/html5-shiv/
* Reference: http://remysharp.com/2009/01/07/html5-enabling-script/
*/
document.createElement("article");
document.createElement("footer");
document.createElement("header");
document.createElement("hgroup");
@arozwalak
arozwalak / clear.css
Created November 27, 2013 13:17
CSS: Clearfix
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
@arozwalak
arozwalak / log.js
Last active March 9, 2017 22:06
Javascript: Cross browser Log method
function log() {
try {
console.log.apply(console, arguments);
}
catch(e) {
try {
opera.postError.apply(opera, arguments);
}
catch(e) {
alert(Array.prototype.join.call(arguments, " "));
@arozwalak
arozwalak / DOMresults.js
Last active March 9, 2017 22:05
Javascript: Unit Testing
// Test suite
function assert (value, desc) {
var li = document.createElement("li");
li.className = value ? "pass" : "fail";
li.appendChild(document.createTextNode(desc));
document.getElementById("results").appendChild(li);
}
window.onload = function () {
@arozwalak
arozwalak / screenSize.js
Last active March 9, 2017 22:05
Javascript: Show screen size
var vars = {};
api = {
viewport: function() {
var e = window, a = 'inner';
if (!('innerWidth' in window )) {
a = 'client';
e = document.documentElement || document.body;
}
return { width : e[ a+'Width' ] , height : e[ a+'Height' ] };
@arozwalak
arozwalak / .txt
Created December 16, 2013 11:46
WebServer: .htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# ----------------------------------------------------------------------
# Better website experience for IE users
# ----------------------------------------------------------------------
# Force the latest IE version, in various cases when it may fall back to IE7 mode
@arozwalak
arozwalak / dragongame.js
Last active March 9, 2017 22:05 — forked from born2frag/dragongame.js
Javascript: Dragon game
var slaying = true;
var youHit = Math.floor(Math.random()*2);
var damageThisRound = Math.floor(Math.random()*2);
var totalDamage = 0;
while(slaying)
{