Skip to content

Instantly share code, notes, and snippets.

View akroii's full-sized avatar
:bowtie:
Busy Agenturfutzie

Andreas Kroll akroii

:bowtie:
Busy Agenturfutzie
View GitHub Profile
@kahlil
kahlil / get Frontenduser date in Contao.php
Created October 4, 2010 14:53
Contao: get frontend user data
<?php
if (FE_USER_LOGGED_IN)
{
$this->import('FrontendUser', 'User');
$userid = $this->User->id;
$membername = $this->User->firstname;
$lastname = $this->User->lastname;
echo "The user id is " .$userid. " and the user id is also " . $this->User->id;
@lumin3000
lumin3000 / meta-tags.md
Created March 6, 2012 00:11 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
<?php
/**
* Contao Open Source CMS
*
* Copyright (C) 2005-2012 Leo Feyer
*
* Core translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
@mbjordan
mbjordan / mobileNav.js
Created November 19, 2012 15:01
mobileNav.js, an alternative to tinyNav.js without markup assumption
/*
mobileNav.js by Matt Jordan.
*/
(function ($) {
$.fn.mobileNav = function (mobileWidth) {
// Create the <select> element
var selectHTML = '<select name="mobileNav" id="mobileNav" style="display:none">',
currentHref = window.location.href,
checkSize = function () {
@AliMD
AliMD / Useful Htaccess Tricks and Tips.md
Last active October 9, 2024 00:38
Useful Htaccess Tricks and Tips for your websites (better performance, speed up, stability and more) Optimized for wordpress Tested in 1devs server with apache (not nginx)

Useful Htaccess Tricks and Tips for your websites (better performance, speed up, stability and more)

Apache configuration file (.htaccess) .htaccess files are an overhead, this logic should be in your Apache config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html

Techniques in here adapted from all over, including: html5boilerplate: html5boilerplate.com Kroc Camen: camendesign.com/.htaccesss perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ Useful htaccess tricks & tips: http://www.queness.com/post/5421/17-useful-htaccess-tricks-and-tips

@aschempp
aschempp / gist:5245299
Last active August 9, 2023 09:35
Force use of www. domain
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]
@ludo237
ludo237 / .htaccess
Last active July 5, 2024 14:55
The ultimate .htaccess file. Please feel free to fork it, edit it and let me know what do you think about it.
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
# This is the free sample of .htaccess from 6GO s.r.l.
# @author Claudio Ludovico Panetta (@Ludo237)
@anselmh
anselmh / target_blank--external.js
Created July 24, 2013 12:12
Open all external links (different hostname than current page) in new tab/window with plain vanilla JavaScript.
/**
* Open external links in new tab/window
*/
// All http:// links should open in new tab/window. Internal links are relative.
var anchors = document.querySelectorAll('a');
for (var i = 0; i < anchors.length; i++) {
if (anchors[i].host !== window.location.hostname) {
anchors[i].setAttribute('target', '_blank');
@Aupajo
Aupajo / demo.html
Created September 26, 2013 00:43
Simple jQuery multiple-choice quiz
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simple Quiz</title>
</head>
<body>
<form action="/success-page" class="simple-quiz">
<h3>Question 1</h3>
@alstrom
alstrom / new_gist_file.js
Created October 1, 2013 06:38
ClickTag script til HTML5 banner
<script src="http://s1.adform.net/banners/scripts/rmb/Adform.DHTML.js"></script>
<script>
var banner = document.getElementById('click1');
clickTAGvalue = dhtml.getVar('clickTAG', 'http://www.example.com'); //banner will receive clickTAG value - if not defined, banner will land to example.com
landingpagetarget = dhtml.getVar('landingPageTarget', '_blank'); //landingPageTarget variable enables to change target from Adform system.
banner.onclick = function() {
window.open(clickTAGvalue,landingpagetarget); //when banner is clicked it will open new window directing to clickTAG value
}