Skip to content

Instantly share code, notes, and snippets.

View Aurielle's full-sized avatar

Vašek Vrbka Aurielle

View GitHub Profile
@dakur
dakur / regexp-gps-coords.md
Last active December 14, 2017 09:31
Regular expression for checking GPS coordinates

Update: In the end, I've decided to validate against some map API, because there are too many cases which this piece of regexp can not cover.


JavaScript

^(N|S)?\s*(\d*[.])?\d+(\u00b0\s*)?((\d*[.])?\d+((\u0022)|((\u0027\s*)?)?((\d*[.])?\d+?(\u0022)?)?))?[\s\u002c]+(W|E)?\s*(\d*[.])?\d+(\u00b0\s*)?((\d*[.])?\d+((\u0022)|((\u0027\s*)?)?((\d*[.])?\d+(\u0022)?)?))?$

Use flag /i

@Mikulas
Mikulas / .gitattributes
Created August 10, 2015 08:44
git composer.lock differ
/composer.lock -merge diff=composer.lock
@VasekPurchart
VasekPurchart / .gitattributes
Last active April 12, 2019 06:24
composer.lock - disable auto-merging (http://git-scm.com/docs/gitattributes#_performing_a_three_way_merge) #composer #lock #git #merge
/composer.lock -merge
@hrach
hrach / dynamicReturnTypeMeta.json
Last active April 11, 2017 10:35
Dynamic Return Type
{
"methodCalls": [
{
"class": "\\Mockery",
"method": "mock",
"position": 0,
"mask": "%s|\\Mockery\\MockInterface"
},
{
"class": "\\Nette\\DI\\Container",
@hrach
hrach / nginx.conf
Created June 9, 2014 20:50
nginx + Nette framework rewrite
server {
listen 80;
server_name example.com;
root d:/webs/example.com/www;
index index.php index.html;
try_files $uri $uri/ /index.php?$args;
location ~ \.phpt?$ {
try_files $uri @missing;
@JakubTesarek
JakubTesarek / .bashrc
Last active October 27, 2021 19:59
.bashrc file with useful shortcuts. The file can update itself using `updaterc`. Also contains detection of platform it's running on
# if not running interactively, don't do anything
[ -z "$PS1" ] && return
# Detect platform
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'FreeBSD' ]]; then
platform='freebsd'
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@MartinSadovy
MartinSadovy / localEncoding.php
Last active December 12, 2015 12:28
Windows uses the local character encoding (cp125*) for file and directory name.
<?php
function utf8ToLocalEncoding($s) {
if (substr(PHP_OS, 0, 3) === 'WIN') {
$tmp = explode(".", setlocale(LC_CTYPE, 0));
if (isset($tmp[1]) && is_numeric($tmp[1]))
$s = @iconv("UTF-8", "cp" . $tmp[1] . "//TRANSLIT", $s);
}
return $s;
}
@fprochazka
fprochazka / BasePresenter.php
Created October 6, 2012 16:22
Image pipe for #nettefw templates
<?php
/**
* @author Filip Procházka <filip@prochazka.su>
*/
abstract class BasePresenter extends Nette\Application\UI\Presenter
{
/**
* @var \Img\ImagePipe
@jsifalda
jsifalda / common.conf
Created August 12, 2012 12:21
Nette nginx configuration
# Please paste to folder common/common.conf
index index.html index.htm;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
#location ~ \.(js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ { }