Skip to content

Instantly share code, notes, and snippets.

View kahlil's full-sized avatar

Kahlil Lechelt kahlil

View GitHub Profile
@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;
@kahlil
kahlil / Publish news with a specific time.php
Created January 19, 2011 09:22
Contao: publish news at a specific time
<?php
// Put into dcaconfig.php
// For news
$GLOBALS['TL_DCA']['tl_news']['fields']['start']['eval']['rgxp'] = 'datim';
$GLOBALS['TL_DCA']['tl_news']['fields']['start']['eval']['maxlength'] = '16';
$GLOBALS['TL_DCA']['tl_news']['fields']['stop']['eval']['rgxp'] = 'datim';
$GLOBALS['TL_DCA']['tl_news']['fields']['stop']['eval']['maxlength'] = '16';
// For articles
@kahlil
kahlil / Check for enter key using jQuery.js
Created January 20, 2011 11:12
Check for enter key using jQuery
$('#input_text').keyup(function(e) {
//alert(e.keyCode);
if(e.keyCode == 13) {
alert('Enter key was pressed.');
}
});
@kahlil
kahlil / script.js
Created January 25, 2011 17:25
Script for the editable navigation.
$(function() {
$( "#mainnavopt" ).sortable({
connectWith: ".mainnavconnect",
placeholder: "ui-state-highlight"
});
$( "#subnavopt" ).sortable({
connectWith: ".subnavconnect",
tolerance: 'intersect',
@kahlil
kahlil / README.txt
Created January 25, 2011 17:25
Editable navigation
Use jQuery and jQuery UI with the ui-lightness theme with this.
K
@kahlil
kahlil / Get the tstamp of the last day or the first day of last month.php
Created February 2, 2011 10:11
Get unix tstamp from the firs day or the last day of the last month
<?php
/**
* Get the first or the last day of last month or the current month
* @parameter can be "first day" or "last day"
* @parameter can be true or false. Will use the current month when false.
*/
function get_tstamp_lastmonth($first_or_last_day, $last_month = true)
{
@kahlil
kahlil / LeagueTable.php
Created February 15, 2011 12:10
Add cronjobs in Contao.
<?php
class LeagueTable extends Frontend
{
public function getData()
{
// curl_init
// regexp & DOM
$this->Database->prepare("UPDATE tl_leagueinfo SET tstamp=?, table_info=?, WHERE id=1")->execute(time(), $arrTable);
}
@kahlil
kahlil / MyModule.php
Created February 15, 2011 14:10
Update the localconfig.php file from your module or hook in Contao
<?php
$this->Config->update("\$GLOBALS['TL_CONFIG']['myVar']", 'myValue');
@kahlil
kahlil / _config.yml
Created June 18, 2011 13:50 — forked from edavis10/_config.yml
Pagination in Jekyll
# ....other stuff here
paginate: 10
@kahlil
kahlil / Twilight.bbcolors
Created August 11, 2011 13:02
A Twilightish colorscheme for BBEdit 10+. Drop the file into '~/Library/Application Support/BBEdit/Color Schemes/' to use it.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundColor</key>
<string>rgba(0.000000,0.000000,0.000000,1.000000)</string>
<key>CommentsColor</key>
<string>rgba(0.569157,0.569091,0.569188,1.000000)</string>
<key>CtagsIdentifierColor</key>
<string>rgba(0.6,0.0,0.4,1.0)</string>