Skip to content

Instantly share code, notes, and snippets.

View niittymaa's full-sized avatar

niittymaa niittymaa

View GitHub Profile
@niittymaa
niittymaa / UIparallax.html
Created February 5, 2017 10:51 — forked from anestv/UIparallax.html
Parallax scrolling for Semantic UI
<html>
<head>
<style>
/* user styles */
body {
max-width: 900px;
margin: auto;
padding: 1em;
}
@niittymaa
niittymaa / MathHelper.js
Created January 11, 2017 18:11 — forked from demonixis/MathHelper.js
JavaScript Math helper
var MathHelper = {
// Get a value between two values
clamp: function (value, min, max) {
if (value < min) {
return min;
}
else if (value > max) {
return max;
}
@niittymaa
niittymaa / LerpColor.js
Last active January 26, 2017 05:48 — forked from rosszurowski/lerp-color.js
Linear interpolation for hexadecimal colors.
/**
* A linear interpolator for hexadecimal colors
* @param {String} a
* @param {String} b
* @param {Number} amount
* @example
* // returns #7F7F7F
* lerpColor('#000000', '#ffffff', 0.5)
* @returns {String}
*/
@niittymaa
niittymaa / RestfulRoutes.md
Last active January 26, 2017 05:48 — forked from alexpchin/restful_routes.md
7 Restful Routes
URL HTTP Verb Action
/photos/ GET index
/photos/new GET new
/photos POST create
/photos/:id GET show
/photos/:id/edit GET edit
/photos/:id PATCH/PUT update
/photos/:id DELETE destroy
# =============== #
# Unity generated #
# =============== #
[Tt]emp/
[Oo]bj/
[Bb]uild
/[Ll]ibrary/
sysinfo.txt
*.stackdump
@niittymaa
niittymaa / How to use Images as Radio buttons.md
Created November 3, 2016 15:45 — forked from rcotrina94/How to use Images as Radio buttons.md
How to use images for radio buttons (input-radio).
@niittymaa
niittymaa / get_css.js
Created September 7, 2016 09:17 — forked from carymrobbins/get_css.js
Get all CSS attributes for an element.
var getCss = function(el) {
var style = window.getComputedStyle(el);
return Object.keys(style).reduce(function(acc, k) {
var name = style[k],
value = style.getPropertyValue(name);
if (value !== null) {
acc[name] = value;
}
return acc;
}, {});
@niittymaa
niittymaa / bootstrap-tabs.html
Created March 26, 2016 16:57 — forked from mnewt/bootstrap-tabs.html
bootstrap tabs example
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Le styles -->
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
</head>
<body>
@niittymaa
niittymaa / mkfavicon.sh
Created March 14, 2016 10:27 — forked from pfig/mkfavicon.sh
Make a multi-resolution favicon.ico from a source image, using ImageMagick
#!/bin/bash
# from
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html
convert source-WxW.png -resize 256x256 -transparent white favicon-256.png
convert favicon-256.png -resize 16x16 favicon-16.png
convert favicon-256.png -resize 32x32 favicon-32.png
convert favicon-256.png -resize 64x64 favicon-64.png
convert favicon-256.png -resize 128x128 favicon-128.png