Skip to content

Instantly share code, notes, and snippets.

View paulfarino's full-sized avatar

Paul Farino paulfarino

View GitHub Profile
@paulfarino
paulfarino / crypto.rb
Created February 27, 2018 06:36
Check crypto prices from the command line
require 'json'
require 'net/http'
require 'colorize'
require 'colorized_string'
print ColorizedString["What coin do you want a price for? (BTC Base Pair): "].colorize(:blue)
coin_name = gets
API_URL = "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=#{coin_name}"
@paulfarino
paulfarino / grid.scss
Created November 10, 2017 04:35
Simple CSS Grid, Grid
.wrapper {
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-gap: 10px;
}
@for $i from 1 through 12 {
.col-#{$i} {
grid-column: span #{$i};
}
@paulfarino
paulfarino / app.css
Created November 6, 2017 02:48
Web Animation API Example
#thing {
height: 200px;
width: 200px;
background: grey;
}
@paulfarino
paulfarino / custom_pws_domain.md
Last active August 26, 2017 04:30
Custom Domain on PWS

Org Name: myorg
Space: mycustomspace
Name of App: testapp
Custom Domain Name: domain.com


cf create-domain myorg domain.com

cf create-domain [org name] [custom domain name]

cf create-route mycustomspace domain.com -n testapp

@paulfarino
paulfarino / index.html
Created August 26, 2017 04:25
Offline page - Service worker
<html>
<head>
<title>Service Worker</title>
<script src="index.js"></script>
<script src="service-worker.js"></script>
</head>
<body>
<h3>Background</h3>
<p>
This sample demonstrates basic service worker registration. During the installation step, a
@paulfarino
paulfarino / cssGrid.scss
Created July 11, 2017 21:59
CSS Grid Loop 🌀
$gtc: grid-template-columns;
$gtr: grid-template-rows;
$gcs: grid-column-start;
$gce: grid-column-end;
$grs: grid-row-start;
$gre: grid-row-end;
$gridOptions: (
("gtc", $gtc),
("gtr", $gtr),
@paulfarino
paulfarino / animation.html
Created June 28, 2017 17:58
Request Animation Frame example
<div class="container">
<div class="test">Test</div>
</div>
@paulfarino
paulfarino / scss-type-checking.scssc
Created March 17, 2017 16:59
Type checking for SCSS
////
// A collection of function for advanced type checking
// @author Hugo Giraudel
////
@function is-number($value) {
@return type-of($value) == 'number';
}
@function is-time($value) {
// Check local storage to see if the key 'contrast_increase' has been set to 'true'
window.onload = function() {
if (localStorage.getItem('contrast_increase') === 'true') {
increaseContrast()
} else {
console.log('Do Nothing')
}
};
// Set contrast hex code in local storage
@paulfarino
paulfarino / gist:d6a1532d79386951b3f24c4a9e44c8be
Created January 23, 2017 19:02
Animated Page Transitions via class
document.addEventListener('page:change', function() {
document.getElementById('primary-content').className += 'animated fadeIn';
});
document.addEventListener('page:fetch', function() {
document.getElementById('primary-content').className += 'animated fadeOut';
});