Skip to content

Instantly share code, notes, and snippets.

@AsaAyers
AsaAyers / gist:d25f1bf0ce3394412670
Created April 27, 2015 20:27
Should dispatchers transport Immutable objects or plain data?

Rubber Duck Debugging

Since my Flux stores have Immutable data I'm wondering if it's better to construct those Immutable objects from the raw data before or after sending it through the dispatcher.

Example: I'm building a Twitter clone and I have a MessageStore. One of my views calls messageActions.create("Hello World").

create: function(content) {
    dispatcher.handleViewAction({
        type: ACTIONS.NEW_MESSAGE,

message: { // convert inside the store

#!/usr/bin/env python3
import re
import sys
import i3
def get_focused():
focused = i3.filter(nodes=[], focused=True)
if len(focused) > 0:
return focused[0]
cssMonitor: ->
@selectors = []
for ss in document.styleSheets
for rule in ss.cssRules when rule.selectorText
@selectors.push(rule.selectorText)
@selectors.sort()
isUnused = (sel) ->
try
$(sel).length == 0
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
coffeelint:
tests:
files:
src: [
'Gruntfile.coffee'
]
  • e675f89...a7822d3 master -> master (forced update)
  1. Create a local branch where master belongs.

    git checkout -b fixmaster e675f89

a. If someone pushed to master between the last time you pulled and now you'll need to go to github to get the full hash. Go to https://github.com/<owner>/<repo>/commit/e675f89 and it'll have the full hash on the page.

`git fetch origin <full hash of e675f89>`

git checkout -b fixmaster e675f89

@AsaAyers
AsaAyers / test.js
Created March 30, 2012 21:41
nodejs-mysql-native Issue 62 test
// To run this you'll have to change the db.auth, but the rest should run without modification.
"use strict";
var create_query = "create temporary table test (`id` int(11) NOT NULL AUTO_INCREMENT, StringA varchar(255) NOT
NULL, BoolA tinyint(1) NOT NULL, StringB varchar(255) NOT NULL, BoolB tinyint(1) NOT NULL, PRIMARY KEY (`id`))";
var db = require("mysql-native").createTCPClient(); // localhost:3306 by default
db.auto_prepare = true;
db.auth("wko", "root", "");
{% extends "::base.html.twig" %}
{% block stylesheet_block %}
{{ parent() }}
{% stylesheets
'@SedlmayrReportsBundle/Resources/public/css/listReport.css'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" />
{% endstylesheets %}
{% endblock %}
@AsaAyers
AsaAyers / Base Layout
Created August 6, 2011 22:04 — forked from catchamonkey/Base Layout
base.html.twig
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheet_block %}
{% stylesheets
'@SedlmayrReportsBundle/Resources/public/css/styles.css'
'@SedlmayrReportsBundle/Resources/public/css/reset.css'
%}
@AsaAyers
AsaAyers / crowd.php
Created July 31, 2011 00:17
PHP Crowd Authentication
<?php
/**
* This file demonstrates using Atlassian Crowd for Single Sign On.
*/
$crowd_app_name = 'REMOVED';
$crowd_app_password = 'REMOVED';
$crowd_url = 'http://crowd.REMOVED.com/crowd/services/SecurityServer?wsdl';
// http://pear.php.net/package/Services_Atlassian_Crowd