Skip to content

Instantly share code, notes, and snippets.

Avatar

Till tgloeggl

  • ELAN e.V., Zentrum virtUOS
View GitHub Profile
@tgloeggl
tgloeggl / squid-deb-proxy_on_docker.md
Created Aug 10, 2018 — forked from dergachev/squid-deb-proxy_on_docker.md
Caching debian package installation with docker
View squid-deb-proxy_on_docker.md

TLDR: I now add the following snippet to all my Dockerfiles:

# If host is running squid-deb-proxy on port 8000, populate /etc/apt/apt.conf.d/30proxy
# By default, squid-deb-proxy 403s unknown sources, so apt shouldn't proxy ppa.launchpad.net
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
  && (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
  && (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
  || echo "No squid-deb-proxy detected on docker host"
@tgloeggl
tgloeggl / emoji.patch
Created Feb 26, 2015
Add Emoji's to Stud.IP trunk
View emoji.patch
diff --git a/app/controllers/admin/smileys.php b/app/controllers/admin/smileys.php
index 9635c8a..17fda49 100644
--- a/app/controllers/admin/smileys.php
+++ b/app/controllers/admin/smileys.php
@@ -72,11 +72,11 @@ class Admin_SmileysController extends AuthenticatedController
$name = Request::get('name', $smiley->name);
if ($smiley->name != $name) { // rename smiley
if (Smiley::getByName($name)->id) {
- $error = sprintf(_('Es existiert bereits eine Datei mit dem Namen "%s".'), $name . '.gif');
+ $error = sprintf(_('Es existiert bereits eine Datei mit dem Namen "%s".'), $name . '.png');
@tgloeggl
tgloeggl / forum.js.patch
Created Jan 14, 2015
Toolbar bei Bereichesbearbeitung anzeigen
View forum.js.patch
--- a/public/plugins_packages/core/Forum/javascript/forum.js
+++ b/public/plugins_packages/core/Forum/javascript/forum.js
@@ -243,6 +243,11 @@ STUDIP.Forum = {
name : jQuery('tr[data-area-id=' + area_id + '] span.areaname').text().trim(),
content : jQuery('tr[data-area-id=' + area_id + '] div.areacontent').attr('data-content')
}));
+
+
+ if (!STUDIP.WYSIWYG) {
+ $('span.edit_area textarea').addToolbar();
View plugin.php
<?php
class YouTubePlugin extends StudipPlugin implements SystemPlugin
{
function __construct()
{
parent::__construct();
StudipFormat::addStudipMarkup('youtube1', '\[youtube\]', '\[\/youtube\]', 'YouTubePlugin::markupYouTube');
StudipFormat::addStudipMarkup('youtube2','\[(you)\](.*?)(?=\s|$)', null, 'YouTubePlugin::markupYouTube', 'links');