Skip to content

Instantly share code, notes, and snippets.

View roblafeve's full-sized avatar
🥽

Rob LaFeve roblafeve

🥽
View GitHub Profile
@roblafeve
roblafeve / README.md
Last active December 10, 2015 01:19
A button style base (Requires Compass)

Use

Button Colors

Add or adjust color subclasses by defining background-color.

Icons

Create a new subclass for .icon (e.g. &.phone:before/after) and add the character as the content (e.g. content: 'x'). Depending on whether the icon is inserted before or after the button text, add a trailing or leading space (e.g. 'x 'for :before or ' x' for :after). Entypo (http://www.entypo.com) is the icon font used here, but can easily be replaced with one of your choice, or scrapped altogether if you prefer to link directly to an image (NOTE: content: url('...') would be an interesting way to add this with the current :before/:after element implementation)

@roblafeve
roblafeve / sass-scaffold.rb
Created August 13, 2013 21:55
A little Ruby script for generating a basic Sass scaffold
folders = [
'settings',
'effects',
'skin',
'typography',
'layout',
'module'
]
def writeFile(filename, text)
@roblafeve
roblafeve / _heading-scale.scss
Created August 21, 2013 21:46
A mixin that allows rapid creation of dynamic heading sizes based on any defined ratio. (Credit to @albatrocity for helping me out on this one.)
@mixin header-scale($ratio: 5, $top-offset: 0, $bottom-offset-ratio: 0.875, $header-rank-shift: -1, $min-width: null, $max-width: null) {
$min-width-query: "(min-width: #{$min-width})";
@if $min-width == null {
$min-width-query: "";
}
$max-width-query: "(max-width: #{$max-width})";
@if $max-width == null {
$max-width-query: "";
}
@roblafeve
roblafeve / modal_sans-js.html
Created November 10, 2013 23:57
A vertically-aligned, overflow-scrollable CSS-only modal.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Modal Sans-JS</title>
<style>
* { box-sizing: border-box }
body {

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@roblafeve
roblafeve / confident-and-comfortable-with-node.md
Last active August 29, 2015 14:27
Getting Confident and Comfortable with Node.js

Getting Confident and Comfortable with Node.js

What is Node?

Simply, a Javascript runtime.

The success of Node

  1. Asynchronous as First Class Citizen
  2. Non-blocking I/O
  3. Event-driven I/O
  4. Single Threaded

Actions

Actions correspond to Redux Async Action Creators and are responsible for dispatching store actions (found:'../src/store') or other async actions.

Typical Structure

While the specific implementation may vary, async actions take this basic form. Partial application is used to provide easy dependency injection (useful for easy testing of success and failure cases).

index.js

Keybase proof

I hereby claim:

  • I am roblafeve on github.
  • I am roblafeve (https://keybase.io/roblafeve) on keybase.
  • I have a public key ASDF7gNVhCwvUTZJfZJ9WNBYhGgazV2yS_7BE24lsuCiKQo

To claim this, I am signing this object:

@roblafeve
roblafeve / reduce.js
Last active May 27, 2017 20:13
Recursive Reduce
// Recursive Reduce
const reduce = (x, y, z) => {
const head = z[0]
return !head
? y
: reduce(x, x(y, head), z.slice(1))
}
// Direct usage of reduce
reduce((acc, x) => acc + x, 0, [1, 2, 3]) // 6
@roblafeve
roblafeve / fp.md
Last active February 7, 2018 15:36
FP Concepts

Morphism

Morphisms can have any of the following properties.

A morphism f :: a -> b is a:

  • monomorphism (or monic) if f ∘ g1 = f ∘ g2 implies g1 = g2 for all morphisms g1, g2 : x → a.
  • epimorphism (or epic) if g1 ∘ f = g2 ∘ f implies g1 = g2 for all morphisms g1, g2 : b → x.
  • bimorphism if f is both epic and monic.
  • isomorphism if there exists a morphism g : b → a such that f ∘ g = 1b and g ∘ f = 1a.[b]