Skip to content

Instantly share code, notes, and snippets.

View kaplas's full-sized avatar

Jouni Kaplas kaplas

View GitHub Profile
@kaplas
kaplas / .bootstrap-web-app.md
Last active December 5, 2015 17:48
Bootstrap an empty directory easily with web tech assets

Bootstrap an empty directory easily with web tech assets

This is a collection of some aliases that I regularly use to bootstrap an empty directory for web app development.

@kaplas
kaplas / Mac.md
Last active August 29, 2015 14:14
Setting up a new Mac

Setting up a new Mac

Folders

  • mkdir ~/Projects

App installs

  • Everything what I own from Mac App Store
  • Latest XCode from Mac App Store
@kaplas
kaplas / Raspberry-Pi-for-Google-Cloud-Print.md
Last active August 23, 2023 21:45
How to set up a RPi as a Google Cloud Print server
@kaplas
kaplas / Raspbmc-for-composite-TV.md
Last active August 29, 2015 14:06
Setting up Raspbmc to be used with an old TV
@kaplas
kaplas / prezto-install.sh
Last active September 28, 2016 07:40
Install prezto to a vagrant/*nix box with a single command
#!/bin/zsh
#
# This script installs prezto into a vagrant/*nix box which already has zsh and oh-my-zsh
# installed. It also replaces the prompt color and enables the git prezto module. If
# executed via the suggested command below, also the default shell is changed into zsh.
# BTW, if using this for a vagrant box, be sure to execute the command while ssh'd into
# the box.
#
# Usage: curl -L https://raw-gist-file-address-here.sh | zsh && chsh -s $(which zsh)
#
@kaplas
kaplas / feedback.md
Created June 24, 2014 05:24
Clojure training feedback (June 2014)

Clojure training feedback (June 2014)

In June 2014 Futurice bought a two-day Clojure training from Metosin. It was held in our office in Helsinki, and had 20-something participant Helsinki, Tampere and Berlin. I was there as well, as a total Clojure-newbie.

It was two days very well spent. However I felt that there were quite a many things that could have gone better. As I managed to miss the official feedback form, I decided to write this letter. As many of the things I'm going to list here are quite generic things and ideas, I decided to make this into a gist, so other tech trainers can benefit from it as well.

Metosin dudes, don't get me wrong. I'm writing this to help you, not to bash you. I think you are incrediably talented people, and you have all what it takes to give world-class Clojure trainings. I just want to help you to get there.

@kaplas
kaplas / gist:11248521
Last active August 29, 2015 14:00
Observations about replacing Compass with node-sass (using libsass) + autoprefixer

Observations about replacing Compass with node-sass (using libsass) + autoprefixer

  • Node-sass is quite easy to use, but a custom grunt task will always require more custom boilerplate code than ready made compass grunt plugins (didn't try grunt-sass because we needed to use autoprefixer as well)
  • Absolute image paths don't work too well with node-sass. Ie. URL 'images/foo.bar', with node-sass imagePath '' will get transformed into '/images/foo.bar', which will of course break stuff. I had to make a dirty hack to overcome that one.
  • Image URL cache busters are not yet implemented in libsass
  • I couldn't get CSS source maps to work, but there was quite a many variables in our setup (eg. a Vagrant VM), so I'm not sure where the problem actually was
  • Autoprefixer was super easy to use, and worked out of box
  • We weren't using as much Compass mixins as I though we would be, so replacing those with vanilla CSS didn't take too lo
@kaplas
kaplas / color-mixins.scss
Created September 3, 2013 14:41
SASS + two different color themes + easy and clean to use + clean CSS output = pure awesomeness!
// Defining colors ===========================================
$color-names : '';
$light-colors : '';
$dark-colors : '';
@mixin define-theme-color( $color-name, $light-color, $dark-color ) {
@if ($color-names != "") and (index($color-names, $color-name) != false) {
@kaplas
kaplas / omitAttributes.js
Created May 15, 2013 12:04
A helper function (or underscore mixin) for omitting object properties in multiple levels
var deepCopy = function (value) {
return JSON.parse(JSON.stringify(value));
};
var omitAttributes = function (obj) {
var copy = deepCopy(obj);
var keys = Array.prototype.slice.call(arguments, 1);
function omitIfFound(obj, parts) {
if (parts.length > 0 && obj[parts[0]]) {