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 / 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()) {
@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 / 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 / ElementExists.js
Created June 15, 2014 21:14
Check if Element Exists #jquery
if ($('#myElement').length > 0) {
// it exists
}
@voku
voku / sources.list
Created June 21, 2014 00:47
sources.list -> Debian sid - workstation
#############################################################
################### OFFICIAL DEBIAN REPOS ###################
#############################################################
############### UNSTABLBE ###########################
# Debian sid FAQ - http://wiki.debian.org/DebianUnstable#FAQ
deb http://ftp.de.debian.org/debian/ sid main contrib non-free
deb-src http://ftp.de.debian.org/debian/ sid main contrib non-free
@voku
voku / randomstring.php
Last active August 29, 2015 14:09
generate random string via php - used https://packagist.org/packages/voku/portable-utf8 (UTF8::strlen)
<?php
/**
* generate random string
*
* @param string $len length of the random string
* @param string $characters characters string for the random selection
*
* @return string
*/
<?php
use Mockery as m;
class Swift_Bug543Test extends \PHPUnit_Framework_TestCase
{
public $message = '';
public $mailHtmlBody = '';
public function embeddingImages()
@voku
voku / SassMeister-input.scss
Created November 21, 2014 15:33
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$breakpoints: "25.5em" "32em" "43.5em" "52.5em" "60em";
@for $i from 1 through length($breakpoints) {
$breakpoint: nth($breakpoints, $i);
@voku
voku / input_filter.php
Last active September 27, 2020 06:30
use input filter for php (get, post, get_post, session, cookie)
<?php
//define('SECONDS_IN_A_MINUTE', 60);
//define('SECONDS_IN_A_HOUR', 3600);
//define('SECONDS_IN_A_DAY', 86400);
//define('SECONDS_IN_A_WEEK', 604800);
//define('SECONDS_IN_A_MONTH', 2592000);
//define('SECONDS_IN_A_YEAR', 31536000);
/**
#* * * * * command to be executed
#- - - - -
#| | | | |
#| | | | +----- day of week (0 - 6) (Sunday=0)
#| | | +------- month (1 - 12)
#| | +--------- day of month (1 - 31)
#| +----------- hour (0 - 23)
#+------------- min (0 - 59)