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
What are the "rules" or guidelines for using ' vs " in Elixir? | |
iex> l1 =['test'] | |
['test'] | |
iex> l2 = ['test'] | |
['test'] | |
iex> l1 == l2 | |
true | |
iex> l3 = ["test"] | |
["test"] |
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
defmodule MyPlug do | |
import Plug.Connection | |
def init(options) do | |
# initialize options | |
options | |
end | |
def call(conn, _opts) do |
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
10.29.14 | |
I was following this tutorial: http://www.elixirdose.com/post/lets-build-web-app-with-phoenix-and-ecto | |
Could not mix compile | |
==> postgrex | |
warning: the dependency postgrex requires Elixir "0.15.0" but you are running on v1.0.1 | |
Compiled lib/postgrex/binary_utils.ex | |
Compiled lib/postgrex/error.ex |
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
Are templates scoped to a controller by naming convention? And is that convention two layers deep | |
and implemented with filenames? | |
First convention describes rules for a controller's filename; stipulating that Controller filenames | |
get two parts seperated by | |
an underscore. An application with these three controllers -- PageController, HelloController, and | |
UserController -- should manifest the following file names: | |
controllers | |
|- page_controller.ex |
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
To find the proper cfbundlerid when writing an appmethod or firemonkey delphi application, go to the tools/options/provisioning | |
Then select the build type and provisioning file, then the developer certificate. | |
That will show the "Applicateion Identifier" it will look like: | |
S3AB5SSYN.com.domain.appname | |
Put that in the CFBUNDLER in the project/option/versioninfo |
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
#1. nano ~/.bash_profile | |
#2. add these two lines | |
bind '"\e[A": history-search-backward' | |
bind '"\e[B": history-search-forward' | |
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
I have this framed out and working but I wanted to post this question to see how more experienced Django developers would approach this problem. So to use a simple domain | |
that everyone can understand, I will frame this as a simple reporting page on a web site where an investor wants to view different classes of assets (stocks, bonds, cds, | |
etc). I only show three instrument types but like any project it could grow to many more over the project life cycle. | |
Given the following models . . . | |
class Investor(models.Model): | |
first = models.CharField() | |
blah = models.CharField() | |
blan = models.CharField() |
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
find: ^\n <- select the far left button that toggles regex [.*] | |
replace: <p>\n | |
tags: Sublime Text 2, find blank lines, replace blank lines |
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
##Clone or Copy a virtualenv## | |
The virtualenvwrapper documentation declares that its feature set includes "Wrappers for managing your virtual environments (create, delete, copy)." But I could not find the copy command anywhere. After fruitless for the command I figred that well designed software usually has a predictable answer: | |
$cpvirtualenv Env1 Env2 | |
So that's the ticket. Where Env1 is your existing venv and Env2 is the new one you wish to start. So I riff off of Patrick Altman's handy [setup instructions] for new Django projects to create a local stub (where I have swapped in the dev release of Django 1.5) and add utilities like South. Starting new projects is now as simple as . . . |
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
This is a contrived example that illustrates my problem. I want to subclass a base class (PersonBase) | |
into several different descendant classes. Each person type can have multiple emails and phone numbers | |
The email and phone class should have a 1..n relationship to all the different people subclasses. | |
I thought could structure this as follows, but the FK cannot be created on the abstract base class. What | |
is the best practice for solving this situation . . . instantiate that base model instead of making it | |
abstract? Or try to implement GenericForeignKeys, or do they introduce more problems than they solve? | |
Here's the problem in pseudocode . . . |
OlderNewer