Skip to content

Instantly share code, notes, and snippets.

View alfredbez's full-sized avatar
👨‍💻

Alfred Bez alfredbez

👨‍💻
View GitHub Profile
@alfredbez
alfredbez / gulpfile.js
Created February 18, 2014 11:53
gulp: livereload basic setup
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var prefix = require('gulp-autoprefixer');
var livereload = require('gulp-livereload');
var watch = require('gulp-watch');
gulp.task('default', function () {
gulp.src('sass/app.scss')
.pipe(watch())
.pipe(sass({style: 'compact'}))
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@alfredbez
alfredbez / windows-symlink.txt
Created February 26, 2014 12:00
windows symlink
@alfredbez
alfredbez / accessible.js
Last active August 29, 2015 14:01
Prüft Bilder auf nicht vorhandene und leere ALT-Tags und Links auf nicht vorhandene und leere TITLE-Tags
var bilderOhneAltTag = jQuery('img:not([alt])'),
bilderMitLeeremAltTag = jQuery('img[alt=""]'),
linksOhneTitleTag = jQuery('a:not([title])'),
linksMitLeeremTitleTag = jQuery('a[title=""]');
console.log('Bilder ohne alt-Tag: ' + bilderOhneAltTag.length);
if(bilderOhneAltTag.length > 0){
console.log(bilderOhneAltTag);
}
console.log('Bilder mit leerem alt-Tag: ' + bilderMitLeeremAltTag.length);
if(bilderMitLeeremAltTag.length > 0){
@alfredbez
alfredbez / livereload.sublime-snippet
Created June 4, 2014 09:19
Sublime Text Snippet: Livereload
<snippet>
<content><![CDATA[
<script src="http://localhost:35729/livereload.js"></script>
]]></content>
<tabTrigger>lr</tabTrigger>
<scope>text.html(.basic)</scope>
</snippet>
@alfredbez
alfredbez / load-repo.php
Created June 11, 2014 12:42
Lädt und entpackt Github Repo
<?php
set_time_limit(0);
file_put_contents("tmp/download-module.zip", fopen("https://github.com/author/repo/archive/master.zip", 'r'));
$zip = new ZipArchive;
$res = $zip->open('tmp/download-module.zip');
if ($res === TRUE) {
$zip->extractTo('modules/');
$zip->close();
}
?>
@alfredbez
alfredbez / backup.webspace+databse.txt
Created September 19, 2014 07:17
backup Webspace + Database
tar -zcvf ZIELDATEINAME.tar.gz VERZEICHNISNAME
mysqldump -h HOSTNAME -u USERNAME -pPASSWORT ALTERDATENBANKNAME > backup.sql
@alfredbez
alfredbez / deleteSpecificLocalStorage.js
Created October 8, 2014 10:40
cleares localStorage if key begins with specific string
var pattern = 'http://www.domain.com/section/';
for (var key in localStorage){
if(key.substr(0,pattern.length) === pattern){
localStorage.removeItem(key);
console.log('localStorage: cleared key "' + key + '"');
}
}
@alfredbez
alfredbez / .htaccess
Last active August 29, 2015 14:08
use .gz version if available (works with js, css & html files)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule (.*)$ $1.gz [L]
</IfModule>
<FilesMatch ".(js.gz)$">
AddType text/javascript .gz
AddEncoding x-gzip .gz
@alfredbez
alfredbez / SassMeister-input.scss
Created December 12, 2014 09:38
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$primary-color: #333;
$primary-background: #eee;
body {
color: $primary-color;
background: $primary-background;