Skip to content

Instantly share code, notes, and snippets.

View rcerrejon's full-sized avatar
🏠
Working from home

Rafael Cerrejon rcerrejon

🏠
Working from home
View GitHub Profile
@rcerrejon
rcerrejon / form.html
Created June 8, 2016 09:56
TYPO3 Form Example
<f:form object="{tx_caddownload_caddownload}" objectName="search" action="showDownloadSearch">
<label for="search">Suchbegriff:</label>
<f:form.textfield property="criteria" type="text" class="form-control" id="cad-search-input" /> z.B.: "SW11 BA MD01" oder "Anschluss"
<f:form.submit value="Suche starten >" />
</f:form>
@rcerrejon
rcerrejon / antispam.js
Last active June 8, 2016 09:56
Anti Spam Email
$("span.mailto").each(function(){
var at = / at /;
var dot = / dot /g;
var addr = $(this).text().replace(at,"@").replace(dot,".");
$(this).after('<a href="mailto:'+addr+'" title="E-Mail senden">'+ addr +"</a>");
$(this).remove();
});
@rcerrejon
rcerrejon / run.cronjob
Created March 9, 2016 15:09
Cron Job Cheat Sheet
* * * * * *
| | | | | |
| | | | | +-- Year (range: 1900-3000)
| | | | +---- Day of the Week (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month (range: 1-31)
| +---------- Hour (range: 0-23)
+------------ Minute (range: 0-59)
@rcerrejon
rcerrejon / insert.sql
Created February 12, 2016 13:28
Insert all values of a table into another table
INSERT INTO new_table (Foo,Bar,Fizz,Buzz)
SELECT Foo,Bar,Fizz,Buzz
FROM old_table
@rcerrejon
rcerrejon / findByCategories.php
Created February 11, 2016 11:48
Extbase FindBy m:m relation (Categories)
//in Repository
/**
* Findby Categories
*
* @param type $categories
* @return type
*/
public function findByCategories($categories) {
$query = $this->createQuery();
@rcerrejon
rcerrejon / error.php
Last active June 8, 2016 09:57
Error Display
ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE);
@rcerrejon
rcerrejon / error.php
Created February 11, 2016 11:45
Error Display in Typo3
// (In localconf.php):
$TYPO3_CONF_VARS['SYS']['displayErrors'] = '1';
// OR
$TYPO3_CONF_VARS['SYS']['displayErrors'] = '2';
$TYPO3_CONF_VARS['SYS']['devIPmask'] = 'Ihre IP Adresse';
@rcerrejon
rcerrejon / plugin.js
Last active June 8, 2016 09:57
DataTables Table plug-in for jQuery: http://www.datatables.net/
//DataTables Table plug-in for jQuery: http://www.datatables.net/
@rcerrejon
rcerrejon / randomizer.sql
Created February 11, 2016 11:31
Random Number between 1-10 (with no 0)
FLOOR( 1 + RAND( ) *10 )
@rcerrejon
rcerrejon / centeredIcon.css
Created February 11, 2016 11:30
Background absolute center horizontal and vertical
/* CSS in order to center an element (with position absolute) in a container: */
.centeredIcon {
background: url("http://www.google.com/favicon.ico") no-repeat transparent;
width:64px;
height:64px;
position:absolute;
left:50%;
top:50%;
margin-left:-32px; /* half of the width */