This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.col50 { | |
float:left;/* NOTE: allineamento di col50 a six */ | |
width: 450px;/* NOTE: larghezza di col50 */ | |
margin: 25px; | |
} | |
@media (max-width: 700px) { | |
.col50 { | |
float: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.col50 { | |
float:left;/* NOTE: allineamento di col50 a six */ | |
width: 450px;/* NOTE: larghezza di col50 */ | |
margin: 25px; | |
} | |
@media (max-width: 700px) { | |
.col50 { | |
float: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { connect } from 'react-redux' | |
// compose can be implemented in a few different ways: | |
//https://en.wikipedia.org/wiki/Function_composition_(computer_science) | |
// a nice compact way I found is the following: | |
function compose (..._fns) { | |
return (...args) => { | |
const [fn, ...fns] = _fns.reverse() | |
return fns.reduce((acc, f) => f(acc), fn(...args)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
const u = require('updeep'); | |
console.log(u); | |
const state = { | |
users: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Action creator | |
const selectPost = postId => ({ type: 'SELECT_POST', postId }); | |
// A reducer listens for SELECT_POST and saves that in the store. | |
const selectPostAndNavigate = postId => { | |
return dispatch => { | |
dispatch(selectPost(postId)); | |
// Navigate here, e.g. dispatch(push(`/posts/${postId}`)) or use router directly | |
// If you use react-router-redux you don't even actually interact directly with location | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
BUILD_DIR=$(pwd)/.tmp-build | |
rm -rf $BUILD_DIR | |
mkdir $BUILD_DIR | |
docker run \ | |
-v $(pwd)/frontend:/tmp/frontend \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
remote_user: ubuntu | |
sudo: yes | |
gather_facts: True | |
tasks: | |
- name: Ensure valid locale | |
command: locale-gen en_GB.UTF-8 | |
- apt_key: keyserver=hkp://p80.pool.sks-keyservers.net:80 state=present id=58118E89F3A912897C070ADBF76221572C52609D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Since I'm studying a bit of functional programming with Js, | |
* this is an example of how I'd build a widget that fetches images from Reddit, | |
* trying to use a "practical" functional style (thanks to lodahs/fp). | |
*/ | |
requirejs.config({ baseUrl: 'https://cdn.jsdelivr.net' }); | |
requirejs(['lodash/4.13.1/lodash.min', | |
'lodash/4.13.1/lodash.fp.min', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { STEP_NAMES } from '../constants' | |
import { setOrderRef, goToStep } from './actionCreators' | |
import { fetchList as fetchFaqList } from './faqs' | |
import { getCurrentStepName } from '../selectors/wizard' | |
export function goToNextStep (stepData) { | |
return (dispatch, getState) => { | |
const state = getState() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assert 'priority' in {tag_name.to_lower() for tag_name in project.tags.values()}, 'priority tag not found in project tags' | |
# If you find yourself doing this many times, just create a simple test helper function. | |
# A lot easier, more flexible and composable than creating a ProjectTestCaseMixin with a assertProjectTags method to extend. | |
# No need for classes and (multiple/mixin) inheritance at all. | |
def get_normalised_project_tags(project): | |
return {tag_name.to_lower() for tag_name in project.tags.values()} | |
assert 'priority' in get_normalised_project_tags(project), 'priority tag not found in project tags' |