27 Aug 2014 alembic revision --autogenerate -m "<your message>"
alembic upgrade head
Problem: FAILED: Target database is not up to date. Solution: alembic upgrade head
Problem: No such revision '5000106def16' Solution:
sqlite3 db.sqlite3drop table alembic_version; (and exit, ctrl+d)alembic upgrade head27 Aug 2014 W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/quantal-security/main/binary-amd64/Packages 404 Not Found [IP: 91.189.91.14 80]
This is happening because you’re on an unsupported/old version of Ubuntu.
One way to fix it:
nano /etc/apt/sources.list Change all entries referring to http://archive .ubuntu.com/ubuntu to http://old-releases .ubuntu.com/ubuntu 22 Aug 2014 https://gist.github.com/JeffPaine/6213790
Most of the examples involve making your code much faster by using iterators instead of creating copies of the data. Example: xrange
Here’s the video: https://www.youtube.com/watch?v=OSGv2VnC0go
21 Aug 2014 http://css-tricks.com/child-and-sibling-selectors/
That’s an excellent article describing what angle brackets, plus signs, and tildes do in CSS selectors. The illustrations make it especially clear.
06 Aug 2014 You can access the color of the section of the pie chart by using “series.color”:
options = {
series: {
pie: {
innerRadius: 0.5,
show: true,
label: {
show: true,
formatter: function (label, series) {
console.log(series);
return '<div style="font-size:8pt;text-align:center;padding:2px; color: ' + series.color +';">' + label + '<br/>' + series.data[0][1] + '</div>';
},
}
}
},
}; 01 Aug 2014 my_list = ['peach', 'grape', 'apple']
query_parameters = {}
counter = 1
for list_item in my_list:
query_parameters["list_item" + str(counter)] = list_item
counter += 1
where_clause = 'fruits IN(:' + ",:".join(query_parameters.keys()) + ')' # create clause to be inserted into query
query_text = db.text("""
SELECT
fruits
FROM table
WHERE """ + where_clause + """
""")
result = db.engine.execute(query_text, **query_parameters) 30 Jul 2014 I needed to install a newer version of a module from a github commit, but it had the same version number. Heroku just used the cached version of the module and didn’t overwrite it with the newer version.
The easiest fix for this:
Create a file in your application’s root directory called runtime.txt with only “python-3.4.1” written inside. Add, commit, and push the new runtime.txt Change runtime.txt back to “python-2.7.6” Add, commit, and push to clear your virtualenv and reinstall all modules 27 Jun 2014 . * The server quit without updating PID file (/var/run/mysqld/mysqld.pid).
If you’re getting this error message, try using sudo to start mysql.
19 Jun 2014 http://stackoverflow.com/a/18483816/1364191
The bolded section below will automatically submit your form when you select an option from the Typeahead.js dropdown:
$ ( ' #remote .typeahead ' ). typeahead ( null , {
displayKey : ' value ' ,
source : site_search . ttAdapter ()
}). on ( ' typeahead:selected ' , function ( e ){
e . target . form . submit ();
});
19 Jun 2014 https://github.com/twitter/typeahead.js/issues/255
If your text input with typeahead.js is not letting you use the enter key, you need to add a submit button (if you don’t already have one).
You can hide it if you want:
<input type="submit" value="Submit" style="display: none">