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 / not_selectable.css
Created June 4, 2014 10:28
make text not selectable: Make text not selectable by user. - From http://snippetlib.com/css/make_text_not_selectable - DEMO: http://jsfiddle.net/voku/79swC/
.notSelect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@voku
voku / json.php
Created June 4, 2014 10:35
create and parse JSON-DATA via PHP - DEMO: http://ideone.com/bz6gjc
<?php
// create JSON data format
$json_data = array ('id'=>1,'name'=>"rolf",'country'=>'russia',"office"=>array("google","oracle"));
echo json_encode($json_data);
echo "\n\n";
// parse JSON data into PHP object
$json_string='{"id":1,"name":"rolf","country":"russia","office":["google","oracle"]} ';
@voku
voku / imageResize.php
Last active August 29, 2015 14:02
image-resize via ImageWorkshop (PHP) - Link: http://phpimageworkshop.com/
<?php
/**
* Get the name without extension
*
* @param String $filename
*
* @return String | false (by error)
*/
function getFileName($filename)
@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
*/
@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 / 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 / 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 / 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 {
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
/* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) {
<!--
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>