Skip to content

Instantly share code, notes, and snippets.

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

Tom Raithel tomraithel

🏠
Working from home
View GitHub Profile
@tomraithel
tomraithel / README.md
Last active April 26, 2018 10:57
Vorschlag: Component Folder Pattern CoP Frontend

Vorschlag für Componenten-Struktur

Stand: Aktuell

radio
├── Radio.jsx
├── Radio.scss
├── RadioSpec.jsx
@tomraithel
tomraithel / showDataQa.js
Created January 19, 2018 10:43
Snippet to display data-qa attributes on a site
const cssText = `
[data-qa] {
outline: 1px solid #E91E63 !important;
}
[data-qa]:hover {
outline: 2px solid #E91E63 !important;
}
[data-qa]:hover:before {
display: block;
white-space: nowrap;
@tomraithel
tomraithel / gist:3803731
Created September 29, 2012 11:23
RUBY: Round number and strip trailing zeros
"%g" % ("%0.2f" % 16.4555)
@tomraithel
tomraithel / code-review
Last active August 2, 2017 11:52 — forked from evant/code-review
A ruby script to automatically create crucible reviews
#!/usr/bin/env ruby
# A script to create a review on crucible based on the current git branch
#
# To configure settings, create a file named .code-review in your home directory
# The format should be:
# ------------------------------------------------------------------------------
# crucible:
# url: <crucible url>
# username: <username>
# password: <password>
@tomraithel
tomraithel / .htaccess 2
Created February 25, 2013 21:51
LARAVEL: .htaccess configuration on domain-factory
# Apache configuration file
# http://httpd.apache.org/docs/2.2/mod/quickreference.html
# Note: ".htaccess" files are an overhead for each request. This logic should
# be placed in your Apache config whenever possible.
# http://httpd.apache.org/docs/2.2/howto/htaccess.html
# Turning on the rewrite engine is necessary for the following rules and
# features. "+FollowSymLinks" must be enabled for this to work symbolically.
@tomraithel
tomraithel / extract-glyphs.py
Created October 25, 2016 14:29
Create svg files from an icon-font
import sys
if len(sys.argv) < 2:
print 'Usage: python {} webfont-file.svg'.format(sys.argv[0])
sys.exit()
with open(sys.argv[1], 'r') as r:
lines = r.read().split('\n')
glyphs = [x for x in lines if '<glyph' in x]
# for every glyph element in the file
for i in range(0, len(glyphs)):
@tomraithel
tomraithel / keybindings.json
Last active February 22, 2016 14:10
Personal Visual Studio Code Settings & Keybindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "alt+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus"
},
{
"key": "alt+up",
"command": "editor.action.moveLinesUpAction",
@tomraithel
tomraithel / gist:4085483
Created November 16, 2012 08:31
RUBY: A Rakefile for creating a zip from files within a directory
require 'rake/packagetask'
namespace :my_namespace do
desc "Make coffee"
task :make_coffee do
cups = ENV["COFFEE_CUPS"] || 2
puts "Made #{cups} cups of coffee. Shakes are gone."
end
# see http://rake.rubyforge.org/classes/Rake/PackageTask.html
@tomraithel
tomraithel / Untitled-3
Created January 21, 2016 15:15
Cycle.js
import Cycle from '@cycle/core';
import {div, label, input, h1, button, p, makeDOMDriver} from '@cycle/dom';
const _ = require('lodash');
const {Observable} = require('rx');
function f1(sources) {
const sinks = {
DOM: sources.DOM.select('.field').events('input')
.map(ev => ev.target.value)
.startWith('12')
@tomraithel
tomraithel / annoy-corworkers.sh
Last active January 21, 2016 12:43
Annoy coworkers
nohup /bin/bash -c 'WORDS=("please help me" "i am so alone" "i am lonely" "pssssst" "hello" "hey, listen."); while [ 1 = 1 ]; do say "${WORDS[$[ $[ RANDOM % ${#WORDS[@]} ]]]}" -v Whisper -r 1.5; sleep 3; done' &