Skip to content

Instantly share code, notes, and snippets.

View josescasanova's full-sized avatar
:octocat:

jose josescasanova

:octocat:
View GitHub Profile
@josescasanova
josescasanova / my-component.spec.js
Created August 11, 2016 18:21 — forked from thevangelist/my-component.spec.js
The only React.js component test you'll ever need (Enzyme + Chai)
import React from 'react';
import { shallow } from 'enzyme';
import MyComponent from '../src/my-component';
const wrapper = shallow(<MyComponent/>);
describe('(Component) MyComponent', () => {
it('renders without exploding', () => {
expect(wrapper).to.have.length(1);
});
const foo: {bar: boolean} = {bar: true};
if (foo.baz) {
console.log('blargh');
}
@josescasanova
josescasanova / setup_selenium.sh
Created March 17, 2016 04:11 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
/*
==============================================
CSS3 ANIMATION CHEAT SHEET
==============================================
Made by Justin Aguilar
www.justinaguilar.com/animations/
Questions, comments, concerns, love letters:
function hello(name, age) {
alert("Hello "+name+", you’re "+age+" years old!");
}
hello("Anon", 42); // "hello Anon, you’re 42 years old!"
hello("Baptiste"); // "hello Baptiste, you’re undefined years old!"
hello("Bulat", 24, 42); // "hello Bulat, you’re 24 years old!
function foo() {
function a() {} // local 'a' is a function
a = 12; // local 'a' is now a number (12)
return a; // return the local 'a' (12)
}
var a = 42;
function foo() {
a = 12;
return a;
function a(){}
}
var a = 2;
function foo() {
var a; // 'a' declaration is moved to top
return a;
a = 5;
}
var a = 2;
function foo() {
return a;
var a = 5;
}
var a = {}, b = {};
a.foo = 42;
b.foo = 18;
a.alertFoo = function() { alert(this.foo); };
a.alertFoo(); // 42
a.alertFoo.call(b); // 18