Skip to content

Instantly share code, notes, and snippets.

View miloskroulik's full-sized avatar

Miloš Kroulík miloskroulik

View GitHub Profile
@miloskroulik
miloskroulik / cartaro_train_sld
Created October 4, 2013 17:08
example of simple SLD file accepted by OpenLayers
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>trainsample</Name>
<UserStyle>
<Name>trainsample</Name>
<FeatureTypeStyle>
<Rule>
<Name>Bridges</Name>
<ogc:Filter>
@miloskroulik
miloskroulik / view_mode_tabs_views.php
Created January 23, 2014 09:23
Example of view, which assigns path for a view mode and adds a local tab for this view mode. You'll probably want to use Tab tamer module (https://drupal.org/project/tabtamer) for reordering the tabs.
$view = new view();
$view->name = 'replace_node_tabs';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Replace node tabs';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@miloskroulik
miloskroulik / template.php
Last active August 29, 2015 14:01
Attempt to redefine hook_bootstrap_colorize_text
<?php
function pasporty_bootstrap_bootstrap_colorize_text_alter($texts) {
$texts = array(
'contains' => array(
t('Save') => 'primary'
)
);
dpm($texts);
}
@miloskroulik
miloskroulik / tables_samewidth.html
Last active August 29, 2015 14:01
Shows how to create multiple HTML tables, where first column (th cell) is of the same width.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name=description content="">
<meta name=viewport content="width=device-width, initial-scale=1">
<title>Test zarovnaných tabulek</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<style type="text/css">
table {
@miloskroulik
miloskroulik / poznamky-hackathon-2014.md
Last active August 29, 2015 14:09
Zápisky z GIS Hackathonu Brno 2014 #python #GIS

Zápisky z GIS Hackathonu 2014

Geopython

OWS - open web services

  • nejsou to webové služby

pydoc

@miloskroulik
miloskroulik / postgresql_slug.md
Last active August 29, 2015 14:09
How to generate slug from (Czech) string in PostgreSQL 9.3 #postgresql
  1. install extension unaccent
  2. use this snippet: unaccent(replace(lower(),' ','-'))
@miloskroulik
miloskroulik / move_to_parent.sh
Last active August 29, 2015 14:14
Move all directories and files (including hidden ones to parent directory #bash #linux #unix
# You could turn on dotglob:
shopt -s dotglob # This would cause mv below to match hidden files
mv /path/subfolder/* /path/
# In order to turn off dotglob, you'd need to say:
shopt -u dotglob
@miloskroulik
miloskroulik / pip_install_error.md
Last active August 29, 2015 14:14
How to solve pip install error #python #pip

Jak vyřešit:

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

při instalaci balíčku přes pip na Ubuntu 14.04. Je potřeba nainstalovat:

sudo apt-get install python2.7-dev

@miloskroulik
miloskroulik / features_tipy.md
Last active August 29, 2015 14:16
Tips for working with Features #drupal #features

How to work with custom features hosted with GIT

@miloskroulik
miloskroulik / compare_directory_trees.sh
Last active August 29, 2015 14:16
Compare 2 directory trees #unix #linux
diff <(cd dir1 && find | sort) <(cd dir2 && find | sort)