Skip to content

Instantly share code, notes, and snippets.

View voku's full-sized avatar
:octocat:
There is nothing good unless you do it.

Lars Moelleken voku

:octocat:
There is nothing good unless you do it.
View GitHub Profile
@voku
voku / jquery-foreach.js
Created June 11, 2014 20:42
The ".each()" method is designed to make DOM looping ... - http://api.jquery.com/each/
$('p.article').each(function(index) {
console.log($(this).html());
});
@voku
voku / mysqldump.sh
Last active August 29, 2015 14:02
mysqldump & remove SECURITY DEFINER from VIEWS
mysqldump -u your_user --skip-comments --complete-insert --databases your_db | grep -v 'SQL SECURITY DEFINER' > ~/your_dump.sql
@voku
voku / redirect.php
Last active August 29, 2015 14:02
php redirect via header-location
/**
* redirect-wrapper
*
* @param String $location
* @param Boolean $moved_permanently
*/
function redirect($location, $moved_permanently = false)
{
if (!headers_sent()) {
<!--
Desktop:
[1 2 3] [1 2 3 4 5 6 7 8 9]
Mobile:
[1 2 3]
[1 2 3 4 5 6 7 8 9]
-->
<div class="row">
<div class="col-md-9 col-md-push-3">1 2 3 4 5 6 7 8 9 </div>
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
/* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) {
@voku
voku / submitViaEnter.js
Created June 6, 2014 13:05
submit form on enter: This function will submit a form on enter when called from onkeypress. - From http://snippetlib.com/jquery/submit_form_on_enter
function submitenter(myfield,e) {
var keycode;
if (window.event) {
keycode = window.event.keyCode;
}
else if (e) {
keycode = e.which;
}
else {
@voku
voku / jQuery-with-precent.js
Last active August 29, 2015 14:02
get the width in percent via jquery.width() - DEMO: http://jsfiddle.net/voku/r72VV/1/
var selector = $("#getID");
var withPercent = selector.width() / selector.parent().width() * 100;
@voku
voku / validation_date.php
Created June 5, 2014 05:55
date format validation: Validate a date in "YYYY-MM-DD" format. - From http://snippetlib.com/php/date_format_validation
<?php
/**
* check for date-format
*
* @param string $date valid is only "YYYY-MM-DD"
*
* @return bool
*/
function checkDateFormat($date)
@voku
voku / checkEmail.php
Last active March 24, 2019 01:37
check for E-Mail
<?php
/**
* checkEmail
*
* @param String $email
* @param Boolean $mxCheck (do not use, if you don't need it)
*
* @return Boolean
*/
@voku
voku / copy.php
Last active August 29, 2015 14:02
copy files and dirs via php
<?php
/**
* recursively creates & chmod directories
*
* @param String $name
* @param Int $mode (null for default value from config)
*
* @return Boolean
*/