Skip to content

Instantly share code, notes, and snippets.

View miloskroulik's full-sized avatar

Miloš Kroulík miloskroulik

View GitHub Profile
@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)
@miloskroulik
miloskroulik / ufw_openvz.md
Last active August 29, 2015 14:16
Jak jsem povoloval ufw na OpenVZ kontejneru (VPSfree.cz) #openvz #ufw #vpsfree #iptables

Při prvním pokusu na mě ufw při pokusu o povolení vyplivl hlášku:

root@vps:~# ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
ERROR: problem running ufw-init
modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/2.6.32-042stab093.4/modules.dep.bin'
modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/2.6.32-042stab093.4/modules.dep.bin'
modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/2.6.32-042stab093.4/modules.dep.bin'
iptables-restore: line 4 failed
iptables-restore: line 77 failed
@miloskroulik
miloskroulik / presunuti_sloupce_libreoffice.md
Last active August 29, 2015 14:16
Přesunutí sloupce v LibreOffice (resp. OpenOffice) #libreoffice #openoffice
  • Select column B
  • Click anywhere in the highlighted area and drag the column. The mouse pointer should change to show the drag operation.
  • Before you release the mouse button, also press the Alt key. When the mouse pointer is at the left side of column A, release the mouse button.
  • Column B should be moved to the left of column A so that A and B are switched.

Based on https://forum.openoffice.org/en/forum/viewtopic.php?f=9&amp;t=61692#p273152