Skip to content

Instantly share code, notes, and snippets.

View valkum's full-sized avatar

Rudi Floren valkum

View GitHub Profile
/**
* Translates a string to the current language or to a given language.
*
* All human-readable text that will be displayed on the site or sent to a user
* should be passed through the t() function. This ensures that sites can be
* fully translated into other languages.
*
* Here are some examples of translating static text using t():
* @code
* if (!$info || !$info['extension']) {
@valkum
valkum / gist:1054110
Created June 29, 2011 15:36
Delphi Graphentheorie
type
PKnoten = ^TKnoten;
TKnoten = Record
folgeKnoten:PKnoten;
nachbarKnoten:PKnoten;
name:integer;
end;
var
Liste: PKnoten;
@valkum
valkum / ggp.make
Last active December 11, 2015 04:08
core = 7.x
api = 2
projects[] = drupal
; Sandbox module
projects[ggp][download][type] = git
projects[ggp][download][url] = http://github.com/GlobalGameport/ggp_module.git
projects[ggp][type] = module
projects[ggp][version] = 7.x-1.x-dev
private void mergeSortTernary(int l, int r) {
if( l < r ) {
int p = (r-l)/3;
int q = 2*p;
int m1=p+l;
int m2 = l+q;
mergeSortTernary(l, m1);
mergeSortTernary(m1+1, m2);
mergeSortTernary(m2+1, r);
mergeTernary(l, m1, m2, r);
diff --git a/includes/form.inc b/includes/form.inc
index fa52b74..4e00680 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -216,8 +216,11 @@ function bootstrap_form_element_label(&$variables) {
*/
function bootstrap_preprocess_button(&$vars) {
$vars['element']['#attributes']['class'][] = 'btn';
-
- if (isset($vars['element']['#value'])) {
array (
'#theme' => 'links__node',
'#pre_render' =>
array (
0 => 'drupal_pre_render_links',
),
'#attributes' =>
array (
'class' =>
array (
// Media query variables.
@mobile: ~"(max-width: 767px)"; //remove because mobile first
@tablet: ~"(min-width: @screen-tablet)";
@normal: ~"(min-width: @screen-md)";
@wide: ~"(min-width: @screen-lg)";
@valkum
valkum / aegir acl ownership fix
Created March 27, 2014 22:28
Simple Workaround for aegir problem with wrong ownership of uploaded files, e.g. files in files/js/* with ownership www-data
#!/usr/bin/env bash
#Setup as a root cronjob
for f in /var/aegir/platforms/*/sites/*;
do
if [ -d "$f" ]; then
if [ -d "$f/files" ]; then
chown aegir:aegir "$f/files" -R
fi;
if [ -d "$f/privates" ]; then
chown aegir:aegir "$f/privates" -R
@valkum
valkum / xtrabackup
Last active August 29, 2015 14:25
Backupninja Percona Xtrabackup helper. Place under /usr/share/backupninja/xtrabackup
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
#
# duplicity script for backupninja
# requires duplicity >= 0.4.4, and >= 0.4.9 when using a custom tmpdir.
#
######################################
# backupdir: Where to backup to
@valkum
valkum / innobackupex
Last active August 14, 2016 20:06
Use innobackupex with backupninja. Place under /usr/share/backupninja/innobackupex
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
#
# duplicity script for backupninja
# requires duplicity >= 0.4.4, and >= 0.4.9 when using a custom tmpdir.
#
######################################
# backupdir: Where to backup to