Skip to content

Instantly share code, notes, and snippets.

Justin Slamka slamkajs

Block or report user

Report or block slamkajs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@slamkajs
slamkajs / post-merge
Last active Jan 23, 2017
Git post-merge hook to automatically update the platforms and plugins used in your cordova project
View post-merge
#!/usr/bin/env bash
# MIT © Justin Slamka <justin.slamka@zapsolutions.com>
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
# GET LIST OF CHANGED FILES
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
@slamkajs
slamkajs / string.hex2rgba.js
Created Jan 4, 2017
String function that converts a hex value (#FFFFFF) into an rgba value.
View string.hex2rgba.js
/**
* HEX TO RGBA
* Convert a hex string for colors into an rbga value
*
* @param alpha (float) THe opacity value of the color
**/
String.prototype.hexToRgbA = function(alpha) {
var c;
if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(this)){
c= this.substring(1).split('');
@slamkajs
slamkajs / string.color-brightness.js
Created Jan 4, 2017
String function that converts a hex value (e.g., #FFFFFF) into a percentage between 0 and 1. The darker the color, the closer the value will be to zero. The lighter the color, the closer the value will be to one.
View string.color-brightness.js
/**
* HEX TO COLOR TONE
* Convert a hex string for colors into a percentage of color tone
* This function takes accessibility into account when color correcting the brightness differences between RGB
*
* @return float(0, 1)
* black = 0
* white = 1
**/
String.prototype.getColorBrightness = function() {
View CSS3 Media Queries Template
/*
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
You can’t perform that action at this time.