Skip to content

Instantly share code, notes, and snippets.

View rcerrejon's full-sized avatar

Rafael Cerrejon rcerrejon

View GitHub Profile
@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 / error.php
Last active June 8, 2016 09:57
Error Display
ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE);
@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 / 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 / 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 / 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 / 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 / style.css
Last active June 13, 2016 14:25
Media Queries
/* Mobile */
@media only screen and (min-device-width : 375px) and (max-device-width : 667px) {
}
/* Tablet Portrait */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
}
/* Tablet Landscape */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
@rcerrejon
rcerrejon / db.php
Created June 15, 2016 13:51
Query Standard Way in Extbase
/** Connect to the Database by TYPO3_DB */
/** @var DatabaseConnection $db */
$db = $GLOBALS['TYPO3_DB'];
//Execute Query
$result = $db->exec_SELECTgetRows('SELECT * FROM tx_test_tabelle');
//Get Results
return $result;
@rcerrejon
rcerrejon / responsiveVimeo.js
Created July 26, 2016 15:04
Responsive iFrame (video responsive)
if ($('.vimeo-iframe').length > 0) {
oWindowWidth = $(window).outerWidth();
oWindowHeight = $(window).outerHeight();
windowWidth = $(window).outerWidth() - 10;
windowHeight = $(window).outerHeight() - 128;
wCalc = ((windowWidth * 100)/1280);
hCalc = ((windowHeight * 100)/720);
rwCalc = 1280 * (hCalc/100);
rhCalc = 720 * (wCalc/100);
if (oWindowWidth < 1280) {