Skip to content

Instantly share code, notes, and snippets.

View dasim's full-sized avatar

Dalibor Simacek dasim

View GitHub Profile
@dasim
dasim / Gruntifile.js
Created March 20, 2014 08:16
Gruntifile.js watch task part
watch: {
sass: {
files: 'sass/**/*.sass',
tasks: ['sass:dev']
},
js: {
files: ['js/*.js'],
tasks: ['uglify:dev']
@dasim
dasim / 0_reuse_code.js
Created January 21, 2014 07:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dasim
dasim / foundation.dropdown.extended.js
Created May 30, 2013 13:39
Fixed positioning of Zurb Foundation 4 dropdowns in IE8. ZF4 expects you to serve IE8 with mobile stylesheet but if you use respond.js or ZF4 grid polyfill (https://gist.github.com/zurbchris/5068210) you want it to behave differently. Usage: insert after foundation.js and foundation.dropdown.js
/*jslint unparam: true, browser: true, indent: 2 */
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.dropdown.small = function () {
return $(window).width() < 768;
};
}(Foundation.zj, this, this.document));
<!doctype html>
<html class="no-js" lang="cs">
<head>
</head>
<body>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone.js"></script>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script>
$(function() {
@dasim
dasim / mods.css
Created January 10, 2012 15:00
Trello modifications CSS. Smaller fonts, larger cards, more info in one screen.
h3.list-card-title a {
font-size: 11px;
}
div.action-comment p {
font-size: 11px;
}
a.inline-object.action-card {
font-size: 12px;
#!/bin/sh
# odstraní starý soubor
echo "Javascript processing..."
if [ -e html/assets/js/combined.js ]; then rm html/assets/js/combined.js; fi
# sjednotí podle masky js soubory do jendoho a minimalizuje. tady je třeba dávat pozor na jejich pořadí a výběr, tohle je nejjednodušší varianta
cat html/assets/js/*.js > html/assets/js/combined.js
java -jar tools/yuicompressor-2.4.6.jar html/assets/js/combined.js -o html/assets/js/combined.js --charset utf-8
@dasim
dasim / Googlemaps.php
Created February 3, 2011 11:39
Fix is on lines 519 and 520. Variable $this->sensor wasn't converted to string so caused REQUEST_DENIED on direct call of the get_lat_long_from_address() function.
function get_lat_long_from_address($address)
{
$lat = 0;
$lng = 0;
$sensor_str = ($this->sensor) ? 'true' : 'false';
$data_location = "http://maps.google.com/maps/api/geocode/json?address=".str_replace(" ", "+", $address)."&sensor=".$sensor_str;
if ($this->region!="" && strlen($this->region)==2) { $data_location .= "&region=".$this->region; }
$data = file_get_contents($data_location);
$data = json_decode($data);