Skip to content

Instantly share code, notes, and snippets.

@kahlil
kahlil / ultimate-helvetica-fontstack.css
Created November 10, 2010 13:17
The ultimate Helvetica Fontstack with the free font 'TexGyreHeros' as a fallback. Download the @fontface-kit here: http://www.fontsquirrel.com/fonts/TeX-Gyre-Heros
/* regular */
font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
font-weight:400;
font-stretch:normal;
/* condensed */
font-family: "HelveticaNeueCondensed", "HelveticaNeue-Condensed", "Helvetica Neue Condensed",  "HelveticaNeueRomanCondensed", "HelveticaNeue-Roman-Condensed", "Helvetica Neue Roman Condensed", "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", 'TeXGyreHerosCnRegular', "Helvetica", "Tahoma", "Geneva", "Arial Narrow", "Arial", sans-serif;
font-weight:400;
font-stretch:condensed;
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@leofeyer
leofeyer / contao-db-update.php
Created August 9, 2012 13:04
Update path in database
<?php
// Database credentials
$strHost = 'localhost';
$strUser = '';
$strPassword = '';
$strDatabase = '';
// From and to path
$strFrom = 'tl_files/';
@BugBuster1701
BugBuster1701 / gist:5216541
Last active May 17, 2017 07:51
Apache 2.4 htaccess
#Zugriff verbieten
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
#Zugriff erlauben
<IfModule !mod_authz_core.c>
@tim-bec
tim-bec / gist:5711512
Last active September 8, 2017 10:13
Referenzierte Werte aus einer MetaModel Tabelle holen (z.b. Herstellernamen aus einem zweiten MetaModel)
<?php
#Vorbereiten
$producer = MetaModelFactory::byTableName('mm_producer')->findById($arrItem['raw']['producer']);
# Die spalte 'name' aus dem array $producer ausgeben
echo $producer->get('name');
@andreasisaak
andreasisaak / gist:5712103
Last active December 18, 2015 02:39 — forked from tim-bec/gist:5711780
<?php
#Vorbereiten
$longtext = MetaModelFactory::byTableName('mm_projects')->findById($arrItem['raw']['project']['id'])->get('introduction');
# Longtext an string übergeben
echo String::getInstance()->substr($longtext['value'], 120);
?>
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@chani
chani / Contao2srcTo3.php
Last active December 26, 2015 12:39
Script to convert old contao 2 src format to the new one by simply replacing the path with the id's. check comment in file for details.
<?php
/**
* Copyright (c) 2013 Jean Bruenn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@stefansl
stefansl / dcaconfig.php
Last active June 15, 2018 17:31
Some personal improvements in Contao (/system/config/dcaconfig.php)
// Reihenfolge der Headline-Typen ändern
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['options']= array('h2', 'h3', 'h4', 'h5', 'h6', 'h1');
// Artikel und Seiten standardmäßig auf 'veröffentlicht' stellen
$GLOBALS['TL_DCA']['tl_article']['fields']['published']['default'] = true;
$GLOBALS['TL_DCA']['tl_page']['fields']['published']['default'] = true;
// HTML in Überschriften erlauben
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['eval']['allowHtml'] = true;
@psi-4ward
psi-4ward / contao.conf
Last active October 19, 2016 10:44
NGINX Contao 3 Config with PHP-FPM
index index.php index.html index.html;
client_max_body_size 200M;
sendfile on;
error_page 404 /404.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {