Skip to content

Instantly share code, notes, and snippets.

View erotte's full-sized avatar
🏡
Arbeit Arbeit Arbeit

Eckhard Rotte erotte

🏡
Arbeit Arbeit Arbeit
View GitHub Profile
@erotte
erotte / button_spinner.css.sass
Last active February 8, 2018 18:55
Ajax loading indicator (Spinner) with Rails/SASS/Bootstrap 2/FontAwesome
%spinner
@extend [class^="icon-"]
@extend .icon-refresh
@extend .icon-spin
+transition(opacity 1s ease, width 0.7s ease, height 0.3s ease)
position: relative
top: -1px
display: inline-block
overflow: hidden
text-decoration: inherit

Frontend Coding Styleguide

SASS/Compass Style

  • drei Verschachtelungsebenen sollten nicht überschritten werden
  • Selektoren sollen so wenig Abhängigkeiten wie möglich erzeugen, aber so spezifisch wie nötig sein.
  • Verschachtelte IDs sind i.d.R. keine gute Idee.
  • Compass geht vor SASS. Vendor-Prefixe (-moz, -webkit) sollten damit nur in begründeten Ausnahmefällen nötig sein
  • Properties werden gruppiert/sortiert
# https://github.com/barboza/erb2slim/blob/master/erb2slim.sh
gem install haml hpricot ruby_parser slim haml2slim
for i in `find app/views -name '*.erb'` ; do html2haml -e $i ${i%erb}haml ; git rm $i ; rm $i ; done
for i in `find app/views -name '*.haml'` ; do haml2slim $i ${i%haml}slim ; git rm $i ; rm $i ; done
@erotte
erotte / Kopfhörer
Last active December 16, 2015 00:09
Großer Kopfhörer-Vergleichstest in der Appfertigung!
Kopfhörer. Ich mag Kopfhörer.
Mit dem AKG K 240 MKII besitze ich schon einen ganz ordentliches Gerät. Ich benutze ihn gern am Fernseher oder am MacBook Pro und freue mich dabei immer sehr über das austauschbare Kabel. Ich mag auch den neutralen Charakter des K 240, auf Dauer fand ich ihn aber etwas langweilig.
Da ich mich bei der Arbeit am Rechner mit einem "Gehörschutz" besser konzentrieren kann, sollte ein geschlossener Kopfhörer her, der Spass macht und weniger neutral sein darf.
Der Kopfhörer sollte also:
* Am Laptop funktionieren, also niederohmig sein bzw. eine hohe Empfindlichkeit besitzen
* Gerne einen Badewannen-Frequenzgang haben und kräftige, klare Bässe wiedergeben. Spass geht vor Neutralität und Genauigkeit.
* Gut sitzen, damit ich ihn ggf. mehrere Stunden ohne Unterbrechung tragen kann
* Geschlossen sein, um Aussengeräusche abzuschirmen
@erotte
erotte / gist:4170124
Created November 29, 2012 16:22
foreman stackdump
This file has been truncated, but you can view the full file.
Sampling process 63743 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling ruby (pid 63743) every 1 millisecond
Process: ruby [63743]
Path: /Users/erotte/.rbenv/versions/1.9.3-p286/bin/ruby
Load Address: 0x10af13000
Identifier: ruby
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: zsh [1476]
@erotte
erotte / dabblet.css
Created November 13, 2012 11:14
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: red;
background: linear-gradient(left, #f06 50px, yellow 100px, green 150px, transparent 200px );
min-height: 100%;
@erotte
erotte / private.xml
Created August 25, 2012 23:09
KeyRemap4MacBook Umlaute mit ALT-Modifier
<?xml version="1.0"?>
<!-- Key Mappimgs for http://pqrs.org/macosx/keyremap4macbook/ -->
<root>
<item>
<name>German Umlaute on US Keyboard Layout with ALT modifier</name>
<appendix>Change Option+o to ö</appendix>
<appendix>Change Option+a to ä</appendix>
<appendix>Change Option+u to ü</appendix>
<identifier>remap.org.openhort.german_umlaute_with_ALT_modifier</identifier>
@erotte
erotte / gist:3408061
Created August 20, 2012 21:27
verticaly centered with display: table-cell
<!doctype html>
<html lang="de" class="no-js">
<head>
<meta charset="utf-8">
<title>untitled</title>
<meta name="author" content="Eckhard Rotte">
<style type="text/css" media="screen">
html, body {
@erotte
erotte / gist:3407960
Created August 20, 2012 21:14
vertically centered with display: box
<!doctype html>
<html lang="de" class="no-js">
<head>
<meta charset="utf-8">
<title>untitled</title>
<meta name="author" content="Eckhard Rotte">
<style type="text/css" media="screen">
html, body {
@erotte
erotte / gitcal.rb
Created May 18, 2012 22:38
Simple ruby script for creating ical calendars from local git repos
#! /usr/bin/env ruby
# gitcal.rb
# creates an .ics file from a local git repository and loads it into iCal.app
# Usage: `[bundle exec] ruby gitcal.rb [repo_path] [branch] [count_back]`
# A shell wrapper script maybe a good idea, but for me this works as it is.
require 'grit' # https://github.com/mojombo/grit
require 'ri_cal' # https://github.com/rubyredrick/ri_cal