Skip to content

Instantly share code, notes, and snippets.

View VinSpee's full-sized avatar
🏠
Working from home

Vince Speelman VinSpee

🏠
Working from home
View GitHub Profile
export class MyComponent extends React.Component {
componentWillMount() {
const styleid = 'MyComponentStyles'
if (document.head.querySelector(`#${styleid}`) !== null) {
const styles = document.createElement('style');
styles.id = styleid;
styles.append('[foo]{ color: blue; }');
document.head.appendChild(styles);
}
}
import Promise from 'bluebird';
import * as types from '../constants/ActionTypes';
export function loginRequest() {
return {
type: types.LOGIN_REQUEST
}
}
export function login(credentials) {
@VinSpee
VinSpee / gulp
Last active August 29, 2015 13:57 — forked from yodasw16/gulp
var gulp = require('gulp'),
compass = require('gulp-compass');
var sources = {
styles : 'client/app/sass/**/*.scss'
}
gulp.task('styles', function() {
return gulp.src('sources.styles')
.pipe(compass({
@VinSpee
VinSpee / simpleDataBinder.coffee
Last active December 31, 2015 16:19 — forked from k2052/simpleDataBinder.coffee
yay for semantics and valid props
class DataBinder extends jQuery
pubSub: null
constructor: (objectid) ->
@pubSub = $ {}
attribute = "data-bind-#{objectid}"
message = "#{objectid}:change"
$(document).on "change", "[#{attribute}]", (event) =>
$elem = $(event.target)