Skip to content

Instantly share code, notes, and snippets.

@pablopaul
pablopaul / debug_dalek_http_auth.js
Last active December 21, 2015 20:59 — forked from asciidisco/dalek_flocke.js
For debug url with HTTP Auth
module.exports = {
'A lot of screenshots': function (test) {
var resolutions = [{width: 1280, height: 1024}, {width: 1024, height: 768}, {width: 800, height: 600}];
var pages = ['http://123:www@google.com'];
resolutions.forEach(function (res) {
pages.forEach(function (page) {
test.open(page)
.resize(res)
desc "Test env"
task :test_env do
on roles(:all) do
puts fetch(:stage) # puts "local"
if fetch(:stage) == 'local'
puts "helo" # does not put "helo", when called as "cap local test_env", why?
end
end
@pablopaul
pablopaul / index.html
Last active August 18, 2016 09:16 — forked from anonymous/index.html
Getting Started with Redux - JSBin implementation - updated libs - forked from https://gist.github.com/jbinto/780d6b5cfab25b14b991 - source http://jsbin.com/tigakegijo
<!DOCTYPE html>
<html>
<head>
<script src="https://fb.me/react-15.3.0.min.js"></script>
<script src="https://fb.me/react-dom-15.3.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.4.5/react-redux.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
@pablopaul
pablopaul / index.html
Created August 19, 2016 06:20 — forked from anonymous/index.html
JS Bin React workshop boilerplate // source https://jsbin.com/xopuni
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="React workshop boilerplate">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css"/>
<style type="css">
@pablopaul
pablopaul / action-object-1.js
Last active November 21, 2016 10:33
Redux Action Object 1
{
type: 'BACKSPACE'
}
@pablopaul
pablopaul / redux-action-object-2.js
Created November 21, 2016 10:35
Redux Action Object 2
{
type: 'CHARACTER_TYPED',
character: 'x'
}
@pablopaul
pablopaul / redux-action-creator.js
Created November 21, 2016 10:52
Redux Action Creator
const insertCharacterActionCreator = (char) => {
return {
type: 'CHARACTER_TYPED',
character: char
}
};
@pablopaul
pablopaul / redux-reduder-concept.js
Created November 21, 2016 11:05
Redux Reducer Concept
function (a, b) {
// c = Processing result of a and b
return c;
};
@pablopaul
pablopaul / redux-reducer-concept-2.js
Created November 21, 2016 11:17
Redux Reducer Concept 2
function (state, action) {
// newState = Processing result of state and action
return newState;
}
@pablopaul
pablopaul / redux-reducer.js
Created November 21, 2016 11:24
Redux Reducer
const reducer = (state = '', action) => {
switch (action.type) {
case 'CHARACTER_TYPED':
const { character } = action;
return state + character;
case 'BACKSPACE':
return state.substr(0, state.length - 1);