Skip to content

Instantly share code, notes, and snippets.

@kevinsalter
kevinsalter / loading.spec.jsx
Created May 27, 2016 16:44
<Loading /> unit tests
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import Loading from '../src/loading.js';
describe('<Loading />', () => {
const LOADING_PROPS = {
imgSrc: 'https://media.giphy.com/media/feN0YJbVs0fwA/giphy.gif'
};
@kevinsalter
kevinsalter / container.spec.jsx
Created May 27, 2016 16:43
<Container /> unit tests
import React from 'react';
import {shallow, mount} from 'enzyme';
import {assert} from 'chai';
import {spy} from 'sinon';
import Container from '../src/container.js';
describe('<Container />', () => {
it('should show the <Loading /> component be default', () => {
const wrapper = shallow(<Container />);
@kevinsalter
kevinsalter / container.jsx
Created May 27, 2016 16:42
<Container /> example
import React, {Component, PropTypes} from 'react';
import $ from 'jquery';
import Loading from './loading.js';
import MainView from './main-view.js';
class Container extends Component {
static propTypes = {
loadingTimeout: PropTypes.number.isRequired
};
Verifying that +kevinsalter is my openname (Bitcoin username). https://onename.io/kevinsalter
@kevinsalter
kevinsalter / remove all spaces in filesnames
Last active December 18, 2015 23:28
Search and replace on command line to rename files
# change *.* to *.jpg to only target JPGs, for example
# and to customize the search...
# sed -e 's, what you're searching for goes in this space , what you want to replace it with goes here ,g'
#the default example here with turn spaces into nothing ( i.e. remove all spaces from file names )
for i in *.*; do mv "$i" "`echo $i | sed -e 's, ,,g'`"; done
@kevinsalter
kevinsalter / RailsCastsColorScheme.tmTheme
Created June 16, 2013 00:56
RailsCast Colour Scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Railscasts 2</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>