Skip to content

Instantly share code, notes, and snippets.

@mcanas
mcanas / StateDispatcher.js
Created July 27, 2018 16:34 — forked from francisrstokes/StateDispatcher.js
Redux without redux - sharing state and one way data flow using only standard react
import React from 'react';
export class StateDispatcher extends React.Component {
constructor(props) {
super(props);
this.state = props.state || {};
this._dispatch = this.dispatch.bind(this);
}
dispatch(action) {
@mcanas
mcanas / untitled.carbide.md
Last active September 9, 2016 21:11
untitled
@mcanas
mcanas / base-line-grid-bg.scss
Created March 10, 2016 20:26
Quick base line grid background pattern.
$base-line-size: 1.5rem;
$base-line-color: rgba(0,0,0,.35);
$base-line-alt-color: rgba(0,0,0,.15);
html {
font-size: 100%;
line-height: 1.5rem;
}
body.base-line-grid {
@mcanas
mcanas / bloccit-rails-console-assignment.rb
Created August 26, 2015 02:09
Bloccit assignment 29 complete
[63] pry(#<Post>):2> self
=> #<Post:0x007fa9487c9860
id: 1,
title: "First Post",
body: "This is the first post in our system",
created_at: Tue, 25 Aug 2015 21:04:37 UTC +00:00,
updated_at: Tue, 25 Aug 2015 21:04:37 UTC +00:00>
[64] pry(#<Post>):2> self.title
=> "First Post"
[65] pry(#<Post>):2> self.title = 'First post title changed'
@mcanas
mcanas / README.md
Last active August 29, 2015 14:25 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.fss__screen {
background: #eee;
overflow: hidden;
<table>
<thead>
<tr>
<th id="id">id</th>
<th id="firstName">first name</th>
<th id="lastName">last name</th>
<th id="dateOfBirth">date of birth</th>
<th id="email">email</th>
<th id="phone">phone</th>
<th id="password">password</th>
@mcanas
mcanas / gist:9509470
Last active August 29, 2015 13:57
JSBin & QUnit Template
/**********************/
// CODE:
/**********************/
function myTestableCode() {
return true;
}
/**********************/
// TESTS:
// if (!window.L) { window.L = function () { console.log(arguments);} } // optional EZ quick logging for debugging
/**
* A modified (improved?) version of the jQuery plugin design pattern
* See http://docs.jquery.com/Plugins/Authoring (near the bottom) for details.
*
* ADVANTAGES OF EITHER FRAMEWORK:
* - Encapsulates additional plugin action methods without polluting the jQuery.fn namespace
* - Ensures ability to use '$' even in compat modes
*
// if (!window.L) { window.L = function () { console.log(arguments);} } // optional EZ quick logging for debugging
/**
* A modified (improved?) version of the jQuery plugin design pattern
* See http://docs.jquery.com/Plugins/Authoring (near the bottom) for details.
*
* ADVANTAGES OF EITHER FRAMEWORK:
* - Encapsulates additional plugin action methods without polluting the jQuery.fn namespace
* - Ensures ability to use '$' even in compat modes
*