Skip to content

Instantly share code, notes, and snippets.

View alfredbez's full-sized avatar
👨‍💻

Alfred Bez alfredbez

👨‍💻
View GitHub Profile
div.anythingSlider .anythingControls {bottom:-20px !important;-webkit-transition: all 0.2s;}
div.anythingSlider:hover .anythingControls {bottom:0 !important;}
@alfredbez
alfredbez / img-gray.css
Created May 7, 2013 13:25
CSS: grayscale img
#logo-wrap img {
-webkit-filter: grayscale(1);
-webkit-transition:all 0.5s;
}
#logo-wrap img:hover{
-webkit-filter: grayscale(0);
}
@alfredbez
alfredbez / style-selected-text.css
Created April 10, 2013 09:58
CSS: style selected text
h1::selection {
-webkit-text-stroke: 2px #000;
background: transparent;
color: transparent;
}
@alfredbez
alfredbez / console.time.js
Created April 5, 2013 10:08
Javascript: log time
console.time("dosomething");
var foo = 'bar';
console.timeEnd("dosomething");
@alfredbez
alfredbez / fuzzySearch.sql
Last active December 15, 2015 20:19
MySQL: Fuzzy Search
SELECT * FROM `table` WHERE expr1 SOUNDS LIKE 'string'
@alfredbez
alfredbez / connect.inc.php
Created April 4, 2013 12:25
PHP: Create Mysql Connection
<snippet>
<content><![CDATA[
/********************************/
/* MySQL Connection */
/********************************/
if( $_SERVER['REMOTE_ADDR'] != '127.0.0.1' ){
$mysqlhost="${1:localhost}";
$mysqluser="${2:user_remote}";
$mysqlpwd="${3:password_remote}";
$mysqldb="${4:db_name_remote}";
@alfredbez
alfredbez / typo3-backend-switch.js
Last active December 15, 2015 16:39
JavaScript: AJAX check for subfolder
/*
Skript prüft, ob Typo3 auf der jeweiligen Seite verfügbar ist, indem es einen Request an http://seitenname/typo3/index.php sendet und den zurückgegebenen Statuscode prüft.
Da es in einem Firefox Add-On laufen soll, wurde es für den Firefox entwickelt. Läuft aber genauso auch in Chrome.
*/
var http_request = false;
function checkTypo3(){
http_request = false;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
" This must be first, because it changes other options as side effect
set nocp
""""""""""""""""""""""""""
" pathogen init
""""""""""""""""""""""""""
execute pathogen#infect()
syntax on
filetype plugin indent on
@alfredbez
alfredbez / pre-commit
Created April 24, 2015 14:02
Deploy with git, rsync & gulp
#!/bin/sh
### Are any Sass files canged or added?
if git status -s | grep '^M.\+s[ac]ss$'
then
gulp --cwd path/to/gulpfile css
fi
### Are any JS files canged or added?
if git status -s | grep '^M.\+js$'
@alfredbez
alfredbez / typo3.selectStorage.sql
Created February 11, 2015 14:08
Liefert alle Datensätze, die Dateilinks aus dem Storage 1 (meistens "fileadmin") einbinden
SELECT DISTINCT
t4.title as Seite,
t4.uid as SeitenID,
t3.header as Titel,
t3.uid as InhaltsID
FROM
sys_file as t1,
sys_file_reference as t2,
tt_content as t3,
pages as t4