Skip to content

Instantly share code, notes, and snippets.

View ultim8k's full-sized avatar
🛠️
Rock & roll!

Kostas Kapenekakis ultim8k

🛠️
Rock & roll!
View GitHub Profile
@ultim8k
ultim8k / dabblet.css
Created February 26, 2014 14:33
Iron Man suitcase
/**
* Iron Man suitcase
*/
* { box-sizing: border-box; }
.container { padding: 20px; }
.iron_title {
text-align: center;
font-family: stark;
color: red;
@ultim8k
ultim8k / dabblet.css
Created March 6, 2014 16:16
Iron Man suitcase
/**
* Iron Man suitcase
*/
* { box-sizing: border-box; }
.container { padding: 20px; }
.iron_title {
text-align: center;
font-family: stark;
color: red;
@ultim8k
ultim8k / object_constructor.js
Last active August 29, 2015 14:00
Object oriented Javascript
// Object Constructor
var Suit = function(name){
// Private value
var name = name;
// Private function
function getName(){
return name;
}
@ultim8k
ultim8k / string_methods.js
Last active August 29, 2015 14:01
Some methods to use with strings
/**
* Javasting :)
*/
var start_with_space = function (string) {
return /^\s+\S+\s*$/.test(string)
}
var is_blank = function(string) {
return /^\s*$/.test(string)
@ultim8k
ultim8k / dabblet.css
Created May 15, 2014 08:36
Bottom floated elements stack
/**
* Bottom floated elements stack
*/
body { background: #999; font-family: Helvetica; }
* { box-sizing: border-box; }
.cf:before,.cf:after { content: " "; display: table; }
.cf:after { clear: both; }
.the-dialog { width:500px; background: #fff; margin: 10px auto; box-shadow: 0 0 5px; }
.the-dialog__top { background: #eee url('https://dl.dropboxusercontent.com/u/31132753/pics/small_bg.jpg'); background-size:cover; background-position:50% 25%; padding: 20px; }
@ultim8k
ultim8k / dabblet.css
Created May 22, 2014 08:33
zindex-test
/**
* zindex-test
*/
.cnt { max-width: 200px; margin: 10px auto; }
.box { background: #fff; border: 1px solid; height: 50px; margin-bottom: 10px; position:relative; /*z-index: 50;*/ }
.hint-trigger { position: absolute; bottom: 0; }
.hint { position: absolute; top:0; background: #eee; padding: 10px; z-index: 100; }
@ultim8k
ultim8k / linebreaks.js
Created July 9, 2014 15:34
Regular Expressions for manipulating linebreaks (needs review)
var test_str = 'test\n\n\nha\n\n\n\n\n\n\n\nbla\nbla\n';
// Replace more than two \n with two \n
var data = test_str.replace(new RegExp('(\n){3,}', 'gim') , '\n\n');
// normalize line endings to \n, because \r is not recognized as "end of line"
data = data.replace (/\s*\R/g, "\n");
// remove leading and trailing whitespace
data = data.replace (/^\s*|[\t ]+$/gm, "");
@ultim8k
ultim8k / common_media_queries.css
Created January 5, 2015 12:33
Media Queries for Standard Devices
/*
http://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
@ultim8k
ultim8k / dabblet.css
Created January 20, 2015 17:42
indicator bubble
/**
* indicator bubble
*/
body { text-align: center; }
.bubble {
width: 50px;
height: 50px;
display: inline-block;
text-align: center;
background-color: #34a9f3;
@ultim8k
ultim8k / dabblet.css
Last active August 29, 2015 14:14
Psychedelia
/**
* Psychedelia
*/
/*background: #f06;*/
/*background: linear-gradient(45deg, #f06, yellow);*/
/*min-height: 100%;*/
.ball {
width: 15px;
height: 15px;