Skip to content

Instantly share code, notes, and snippets.

View jcgertig's full-sized avatar

Jonathan Gertig jcgertig

View GitHub Profile
@jcgertig
jcgertig / VisibleToUser.js
Created March 15, 2017 19:58
React Pundit
require('./styles.css');
import React, {Component, PropTypes} from 'react';
import { connect } from 'react-redux';
import { meetsPolicy } from 'policies';
class VisibleToUser extends Component {
render() {
let { children, hasUser, type, value, user, action } = this.props;
(function(){alert(1);})()
@jcgertig
jcgertig / Fetchum.md
Last active May 3, 2016 21:05
Fetchum

Fetchum

Fetchum is a simplified api for making xhr requests. It is a wrapper around the native fetch api implemented in new browsers and has the most well know polyfill for fetch as the fallback for older browsers.

It also allows you to build a request function to call later describing how a call will be made using the generateRequest function. This allows for very descriptive usage of a api and increases readability of how requests are made overall.

@jcgertig
jcgertig / redux.md
Last active September 23, 2016 20:10
Redux

Redux

Redux, according to the docs, is "a predictable state container for JavaScript apps." It's a very lightweight (2kB) implementation of flux. If you haven't heard of flux before, that's fine.

Basically, flux is like a sedan. It's a concept with many agreed-upon characteristics associated with it, but it's not, itself, a tangible thing. Just as there's no single definitive "Sedan" that you can go out and buy, there's no definitive "Flux" that you can download and install. Instead, you choose one specific implementation of it. I don't know much about cars, but whatever the most minimal, stripped down, yet highly performant sedan is, that's Redux.

The basic idea behind flux is, you have a dispatcher that sends actions to the data store, and updates the view. It's an overall data flow architecture, where -- unlike the two-way data binding of MVCs -- updates only go one way. If you've ever been in getter/setter hell trying to track what view is touching what model, you can understand how a one-way data f

@jcgertig
jcgertig / VDI Setup.md
Created April 13, 2016 19:56
Get VDI dev setup

Setting up on VDI

Badun - Cygwin, git, zsh, vim

Download from https://babun.github.io/

NVM for Windows

Download it from the github releases. The file you want is nvm-setup.zip.

Install Node

@jcgertig
jcgertig / index.js
Created October 18, 2015 14:37
RadialLoader
/** @flow */
require('./styles.css');
import React from 'react';
var {PropTypes} = React;
class RadialLoader extends React.Component {
render(): ?ReactElement {
return (
@jcgertig
jcgertig / gist:daa56c711de5897029a3
Last active August 29, 2015 14:06
Basic jQuery functions
Element.prototype.attr = function(name, value) {
if (typeof value === 'undefined') {
return this.getAttribute(name);
}
return this.setAttribute(name, value);
};
Element.prototype.val = function(value) {
if (typeof value === 'undefined') {
return this.value;
@jcgertig
jcgertig / Gemfile
Created September 8, 2014 02:02 — forked from anonymous/Gemfile
# gem 'activeadmin', github: 'gregbell/active_admin'
gem 'angular-rails-templates'
gem 'autoprefixer-rails'
gem 'bootstrap_form'
gem 'bootstrap-sass'
gem 'bower-rails'
# gem 'cancan'
gem 'carrierwave'
gem 'devise'
gem 'fancybox2-rails'
@jcgertig
jcgertig / versions.md
Last active August 29, 2015 14:05
Proper versioning for releases

F.0 : Full release all features listed for version and bug fixed.

F.M.0 : Minor release of features that are fully bug tested. This can include a hotfix since it is fully bug tested.

F.M.L : Iteration of features completed does not have to be fully bug tested. Is not a public release but a release for those who like to live on the bleeding edge. Use leters at the end like 1.3.2 D to signify how many were released that week.

@jcgertig
jcgertig / gist:8a2ef7c58e7d62f6a24a
Created May 14, 2014 20:50
Footer word press blogs
<style>
/*Footer Base Css From Core App*/
.shell {
width: 960px;
margin: 0 auto;
padding: 0 10px;
}
#footer {
height: 500px;