Skip to content

Instantly share code, notes, and snippets.

View danielchikaka's full-sized avatar

Daniel Chikaka danielchikaka

View GitHub Profile

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

@danielchikaka
danielchikaka / center.css
Created October 23, 2014 05:32
This css snippet is for centering div in a web page
.centered_div {
width: 100px;
height: 100px;
position: absolute;
top: 50%;
left: 50%;
margin-left: -50px;
margin-top: -50px;
background: red;
}
@danielchikaka
danielchikaka / SickyFooter.html
Last active August 29, 2015 14:08
This gist is the sticky footer hack, for modern browsers .. it supports IE8 too
<div id="wrap">
<div id="header">
</div>
<div id="main">
</div>
=======[ Media Queries - default media query break points ]=======
@media(max-width:767px) {
}
@media(min-width:768px) {
}
@media(min-width:992px) {
=======[ Media Queries - default media query break points ]=======
@media(max-width:767px) {
}
@media(min-width:768px) {
}
@media(min-width:992px) {
@danielchikaka
danielchikaka / jquery-element-visible
Created February 20, 2015 10:26
This gist will help detect if an element is visible on the viewport. For example, if the footer is visible, do something ...
$.fn.is_on_screen = function(){
var win = $(window);
var viewport = {
top : win.scrollTop(),
left : win.scrollLeft()
};
viewport.right = viewport.left + win.width();
viewport.bottom = viewport.top + win.height();
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
Function.prototype.compose = function(argFunction) {
var invokingFunction = this;
return function() {
return invokingFunction.call(this, argFunction.apply(this,arguments));
}
}
@danielchikaka
danielchikaka / angular-remove-white-space-filter.js
Last active August 29, 2015 14:25 — forked from builtbylane/angular-remove-white-space-filter.js
AngularJS – filter: removes white space from text. useful for html values that cannot have spaces
/**
* Description:
* removes white space from text. useful for html values that cannot have spaces
* Usage:
* {{some_text | nospace}}
*/
app.filter('nospace', function () {
return function (value) {
return (!value) ? '' : value.replace(/ /g, '');