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
#!/bin/sh | |
# Show song info from internet radio in pop up window. | |
# | |
# Copyright (c) 2012 Tomáš Ehrlich <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without | |
# restriction, including without limitation the rights to use, | |
# copy, modify, merge, publish, distribute, sublicense, and/or sell |
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 python | |
# -*- coding: utf-8 -*- | |
""" | |
Usage: twilight.py [--city=<city> | --coordinates=<coordinates>] | |
[--date=<date> | --tomorrow] [--week] | |
[-h | --help | --version] | |
Options: | |
-h --help Show this help. | |
--version Show version. |
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
# Append to your urls.py file. | |
# Development | |
from django.conf import settings | |
if settings.DEBUG: | |
from django.conf.urls.static import static | |
from django.contrib.staticfiles.urls import staticfiles_urlpatterns | |
media = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) | |
urlpatterns = media + staticfiles_urlpatterns() + urlpatterns |
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
#!/bin/bash | |
# Helper script to install boot2docker with added guest additions | |
# Directory /Users will be mounted as shared dir. | |
# | |
# Source: | |
# https://medium.com/boot2docker-lightweight-linux-for-docker/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c | |
BOOT2DOCKER_PATH=~/.boot2docker/boot2docker.iso | |
RELEASE=http://static.dockerfiles.io/boot2docker-v1.1.2-virtualbox-guest-additions-v4.3.12.iso | |
RELEASE_MD5=5e39eb7e960e30b433ffefb02bfce4ba |
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
# BAD: | |
from production import * | |
# Good (my personal preference): | |
from myproject.settings.production import * | |
# Good (probably your choice): | |
from .production import * |
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
exports.config = { | |
allScriptsTimeout: 11000, | |
specs: [ | |
'e2e/**/*.coffee' | |
], | |
multiCapabilities: [ | |
{ | |
// 'browserName': 'Safari' |
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
# top-most EditorConfig file | |
root = true | |
# Unix-style newlines with a newline ending every file | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
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
const PureInput = React.createClass({ | |
propTypes: { | |
name: React.PropTypes.string.isRequired, | |
label: React.PropTypes.string, | |
type: React.PropTypes.string, | |
placeholder: React.PropTypes.string, | |
// value/callback pair | |
value: React.PropTypes.string, |
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
// Is there any difference? (In performance for example?) | |
// A: Using default values in object destructuring | |
const A = ({ | |
value = "", | |
foo = "bar", | |
...props | |
}) => {}; | |
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
// just a helper function | |
const updateComponent = (component, newState) => component.setState(newState) | |
// 1st approach using redux-promise. Actions returns promises, so component | |
// can trigger actions when promise is resolved. | |
const handleEventPromise = (props) => (event) => { | |
this.props.action({...}) | |
.then((payload) => updateComponent(this, {...})) | |
} |
OlderNewer