Skip to content

Instantly share code, notes, and snippets.

View ReeMii's full-sized avatar

Remigiusz Loginow ReeMii

  • DCX @ Capgemini Deutschland
  • Munich, Germany
  • X @reemii76
View GitHub Profile
@ReeMii
ReeMii / ios-detect.js
Created May 28, 2015 07:29
ios detect
Modernizr.addTest('ipad', function () {
return !!navigator.userAgent.match(/iPad/i);
});
Modernizr.addTest('iphone', function () {
return !!navigator.userAgent.match(/iPhone/i);
});
Modernizr.addTest('ipod', function () {
return !!navigator.userAgent.match(/iPod/i);
@ReeMii
ReeMii / better-helvetica.css
Created May 8, 2014 07:22
better helvetica
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
}
@ReeMii
ReeMii / console.js
Created April 30, 2014 06:59
console.log patch for IE and class _debug or _d to use instead of console.xxx functions. Minimised version included
if (typeof console === "undefined") {
var console = {
log: function() {},
info: function() {} ,
warn: function() {},
error: function() {}
}
}
_debug = {
log : function(message) {
@ReeMii
ReeMii / image_download.php
Created March 15, 2014 11:11
Download image from url
<?php
function getimg($url, $path, $overwrite = false) {
$imageName= basename($url);
if(file_exists($path.$imageName) && !$overwrite) {
return $path.$imageName;
}
$headers[] = 'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg';
$headers[] = 'Connection: Keep-Alive';
@ReeMii
ReeMii / running.sh
Created February 20, 2014 11:31
Check if service is running on remote host and port
nc example.com 587 < /dev/null; echo $?
@ReeMii
ReeMii / disable-foreign-key-check.sql
Created January 20, 2014 09:45
disable foreign key check
SET FOREIGN_KEY_CHECKS=0;
@ReeMii
ReeMii / constraints.sql
Created December 14, 2013 12:47
Use NOT IN to find where constraints are constraining
SELECT column FROM table WHERE column NOT IN
(SELECT intended_foreign_key FROM another_table)
@ReeMii
ReeMii / select.js
Created December 8, 2013 06:44
select - setting and unsetting
//setting
$('select option:contains("10")').prop('selected', true);
//unsetting
$('select option:selected').removeAttr("selected")
@ReeMii
ReeMii / slug.php
Last active December 30, 2015 05:39
slug
<?php
namespace Application\View\Helper;
use Zend\View\Helper\AbstractHelper;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
class Slug extends AbstractHelper implements ServiceLocatorAwareInterface
{
public function __invoke($str = null, $replace=array(), $delimiter='-')
{
@ReeMii
ReeMii / truncate.sql
Created November 8, 2013 08:23
truncate with foreign keys
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE table1;
TRUNCATE table2;
SET FOREIGN_KEY_CHECKS=1;