Skip to content

Instantly share code, notes, and snippets.

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

Stefan Imhoff kogakure

🏠
Working from home
View GitHub Profile
@kogakure
kogakure / index.html
Created December 28, 2016 21:31
Inline SVG Demo 2
<main class="Demo bg-image">
<div class="Modal">
<h2>Sign In</h2>
<form class="Form">
<label class="Label">
<input class="Input" type="text"
placeholder="Username" name="username"
required minlength="4">
@kogakure
kogakure / gist:4769950
Created February 12, 2013 13:41
SASS: Triangle Mixin
@mixin triangle($width, $dir, $color) {
@if $dir == up {
width: 0;
height: 0;
border-left: $width/2 solid transparent;
border-right: $width/2 solid transparent;
border-bottom: $width/2 solid $color;
} @else if $dir == down {
width: 0;
height: 0;
@kogakure
kogakure / gist:3187467
Created July 27, 2012 11:21 — forked from edennis/gist:3187189
Ruby: Colorized irb prompt for production: ~/.irbrc
# .irbrc
if defined?(Rails) && Rails.production?
conf = IRB.conf[:PROMPT][IRB.conf[:PROMPT_MODE]]
red = "\033[0;31m"
reset = "\033[0m"
[:PROMPT_S, :PROMPT_C].each do |p|
conf[p].gsub!(/^(.*)$/, "#{red}\\1#{reset}")
end
conf[:PROMPT_I] = "#{red}%N(%m):%03n:%i (PRODUCTION) > #{reset}"
end
@kogakure
kogakure / .vimrc
Last active May 20, 2016 13:01
Vim: .vimrc
" ###################
" # Global Settings #
" ###################
" Default shell
set shell=/bin/zsh
scriptencoding utf-8
" #######
" Bundles
@kogakure
kogakure / gist:8647357
Created January 27, 2014 11:55
CSS: Vertical align anything
/* http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/ */
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
#!/bin/sh
# script for optimizing images in a directory (recursive)
# pngcrush & jpegtran settings from:
# http://developer.yahoo.com/performance/rules.html#opt_images
# pngcrush
for png in `find $1 -iname "*.png"`; do
echo "crushing $png ..."
pngcrush -rem alla -reduce -brute "$png" temp.png

What

Bootstrap 3.0 gives you access to the awesome icon set icon set by these dudes but it's not obvious for a Rails newbie like myself to get it all working together nicely

How

  1. Download the bootstrap-glyphicons.css from here. Save that file to RAILS_ROOT/vendor/assets/stylesheet/bootstrap-glyphicons.css
  2. Save all the font files in /dist/fonts from the Bootstrap 3.0 download to a new folder in your Rails app RAILS_ROOT/vendor/assets/fonts
  3. Add this folder to the asset pipeline by appending config.assets.paths << Rails.root.join("vendor","assets", "fonts") to application.rb after the line that has class Application < Rails::Application.
  4. In bootstrap-glyphicons.css modify the the url paths in @font-face to read /assets/FILE_NAME instead of `.
/**
* (C)Leanest CSS spinner ever
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.progress {
position: relative;
@kogakure
kogakure / inline-quotes-example.html
Created November 28, 2013 19:05
SASS/CSS: SASS-Mixin for correct quotes around `q` inline-quotes, with correct nesting.
<!DOCTYPE html>
<html lang="de">
<!-- On the html element -->
<head>
<title>Quote-Demo</title>
</head>
<body>
<!-- or on another element -->
<p lang="de">Luke führte weiter aus, <q>Und sie nannte ihn einen <q>total blöd-aussehenen Idioten</q>! Ich denke ich habe eine Chance!</q> Dieser arme Idiot …</p>
<p lang="en">Luke conntinued, <q>And the she called him a <q>scruffy-looking nerf-herder</q>! I think I’ve got a chance!</q> The poor naive fool …</p>
@kogakure
kogakure / gist:6822967
Created October 4, 2013 08:51
CSS: Prevent font resizing on the iPhone.
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
body {
-webkit-text-size-adjust: none;
}
}