Skip to content

Instantly share code, notes, and snippets.

View chrsgrffth's full-sized avatar

Christian Griffith chrsgrffth

View GitHub Profile
@chrsgrffth
chrsgrffth / tslint.json
Last active June 22, 2018 05:17
TSLINT
{
"extends": [
"tslint-react"
],
"rulesDirectory": [
"node_modules/tslint-eslint-rules/dist/rules"
],
"rules": {
"adjacent-overload-signatures": true,
"align": [
// ----------------------------------------------------------------------------
// Map Functions
// ----------------------------------------------------------------------------
@function to-string($int)
@return inspect($int)
// Still trying to think through if functions would be better than variables.
// * Benefit of variables is autocomplete.
// * Benefits of functions is clearer logic and simplicity in mapping.
// ** Thinking `--` prefixed would identify functions provided by core to be
@chrsgrffth
chrsgrffth / header.coffee
Created June 16, 2016 23:15
A header that hides when scrolling down and shows when scrolling up.
# Vendor.
$ = require('jquery')
# Modules.
animation = require('./animation.coffee')
# Cache jQuery objects.
$document = $(document)
$window = $(window)
$header = $('#global-header')
@chrsgrffth
chrsgrffth / mailchimp-subscribe.coffee
Last active July 10, 2020 14:34
Vue – Mailchimp Subscribe Component
# To get the `action` prop:
#
# 1. Go to your dashboard on mailchimp.com and navigate
# to Lists > Signup Forms > Embedded Forms.
#
# 2. Copy the `<form>` action from the generated HTML code.
#
# 3. Pass that into the component via the prop, like so:
#
# <mailchimp-subscribe
@chrsgrffth
chrsgrffth / modular.scss
Created June 2, 2016 22:58
Modular Scale Calculator
$rem_base: 16px !default;
$ratio: 1.5 !default;
@function whitespace_calculator($ratio, $i) {
$value: $ratio;
@if $i == 0 {
$value: 0;
}
@chrsgrffth
chrsgrffth / Gemfile
Last active June 1, 2016 19:45
Allow Client to Communicate with Rails API (Allow-Access-Control-Origin)
# Rack Cors.
gem 'rack-cors', :require => 'rack/cors'
@chrsgrffth
chrsgrffth / gulpfile.js
Last active May 24, 2016 23:51
Gulpfile/package.json for Statamic Themes
'use strict';
var gulp = require('gulp'),
sass = require('gulp-sass'),
sassGlob = require('gulp-sass-glob'),
concat = require('gulp-concat'),
browserify = require('browserify'),
coffeeify = require('coffeeify'),
uglify = require('gulp-uglify'),
notify = require('gulp-notify'),
@chrsgrffth
chrsgrffth / gulpfile.js
Created May 24, 2016 19:36
Gulpfile/package.json for Browserify (with Coffeescript)
'use strict';
var gulp = require('gulp'),
sass = require('gulp-sass'),
sassGlob = require('gulp-sass-glob'),
concat = require('gulp-concat'),
browserify = require('browserify'),
coffeeify = require('coffeeify'),
uglify = require('gulp-uglify'),
notify = require('gulp-notify'),
@chrsgrffth
chrsgrffth / Gruntfile.coffee
Created December 27, 2014 07:39
Gruntfile
fs = require 'fs'
module.exports = (grunt) ->
grunt.initConfig
concurrent:
start:
tasks: ['nodemon', 'watch']
options:
logConcurrentOutput: true
@chrsgrffth
chrsgrffth / gist:c2b33896138aa1894cfd
Created August 18, 2014 02:59
Forward Port 80 to 3000 for Node.js (from StackOverflow)
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000