Skip to content

Instantly share code, notes, and snippets.

@webpapaya
webpapaya / pie_chart.scss
Created January 5, 2014 10:43
most awesome sass code i ever wrote for my current project food-mesh
$colorTypes: (low, medium, high, ultra-high);
@for $i from 0 to length($colorTypes) {
&.color-amount-#{unquote(nth($colorTypes, $i+1))} {
fill: mix(#19436B, #50B694, $i*length($colorTypes));
}
}
#!/bin/sh
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/home/blogger/apps/blog_app/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E production"
AS_USER=blogger
require 'zip'
require 'fileutils'
class ZipFileExtractor
# Convenience Method
def self.unzip_file_to(*args)
new(*args).unzip
end
def initialize(origin_path, destination_path)
html, body {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
}
@webpapaya
webpapaya / format-date-test.js
Created August 20, 2015 18:32
Unit Test Ember 2.0 Handlebars Helper
// File: tests/unit/helpers/format-date-test.js
/* jshint expr:true */
import { expect } from 'chai';
import {
describe,
it
} from 'mocha';
import time from 'crewmeister/helpers/time';
describe('TimeHelper', function() {
@webpapaya
webpapaya / fun.js
Created October 1, 2015 13:21
the reason for this is pretty clear json only supports the following types string (number, object, array, true, false, null). So JSON.stringify filters out all invalid data types.
JSON.stringify({list: undefined}) // => “{}”
JSON.stringify({list: null}) // => “{list: null}”
@webpapaya
webpapaya / bootstrap_select.less
Last active October 26, 2015 20:55
Bootstraps select lists on iOS devices look kind of broken. This snipped ensures that the select lists look like the normal bootstrap select lists. It also makes sure that the arrow is still clickable by setting the background of the select element to transparent and hides the arrow behind the select list.
@media all and (-webkit-min-device-pixel-ratio: 0) {
select.form-control {
// Make background transparent so that the arrow is "clickable"
position: relative;
z-index: 1;
background: transparent;
-webkit-appearance: none;
}
.select--wrp {
git diff --diff-filter=ACMRTUXB --name-only master...feature-branch | grep '\.rb' | xargs rubocop -a --config .rubocop.yml --force-exclusion
const assert = (description, test) => {
if(test()) { console.log(`✔ ${description}`); }
else { console.error(`✖ ${description}`); }
};
const describe = (description, tests) => {
console.log('----------------------------');
console.log(`%c${description}`, `font-weight:800;`);
tests();
};

Possibilities for a CSS architecture in 2016

CSS in a growing web application is really, really hard. I'm doing CSS related projects on various side projects and my internships in New York and Vienna for a while. Every time I'm starting a new CSS project from scratch I always feel like: This time I need to do it right. The hard truth is, every CSS project I touched until now, didn't feel right, even if they had been touched by Senior Creative Developers (That's what experienced CSS enthusiasts have been called at my internship in New York). At some point the whole styling of your application just feels bloated with special rules everywhere. They either come from browser incompatibilities or designers who want to move a heading 1px to the top and 3px to the bottom. Even though most requirements from designers might seem stupid for us developers, it's the designers job to make the product, landing page or whatever else he was designing look awesome. As developers we somehow need to implement and deliver th