Change Percent To Numbers and Keep Color - Flot Pie Chart
You can access the color of the section of the pie chart by using “series.color”:
You can access the color of the section of the pie chart by using “series.color”:
Updated 2026-09-26: replaced the runtime.txt trick with pinning the commit.
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.
Pinning the commit in requirements.txt fixes it. Heroku’s Python buildpack throws away its package cache whenever that file changes, so the next push reinstalls everything:
somepackage @ git+https://github.com/someuser/somepackage.git@<commit sha>
If requirements.txt isn’t changing, purge the build cache with the heroku-builds plugin and push again:
heroku plugins:install @heroku-cli/heroku-builds
heroku builds:cache:purge -a example-app
git commit --allow-empty -m "Purge build cache"
git push heroku main
. * 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.
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();
});
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">
I’ve always used WinSCP to transfer files between my Windows development environment and Ubuntu. It worked pretty well. All you had to do was open the file with your editor by clicking the file in WinSCP, and when you saved the file it would save to the server in the background.
The main negative was the lack of feedback when a file fails to save to the server. WinSCP could be logged out and asking for a password in the background, but you were expecting that save to fix the bug you were working on. It ended up being another thing to debug.
A coworker suggested using Samba instead. I installed it with this simple guide: How to Create a Network Share Via Samba Via CLI Then I mapped the network drive in Windows by going to the “Map Network Drive” option in the tools menu of the file explorer:

The only negative I’ve found with Samba so far is that it makes Notepad++ a little less responsive. But it helps a small amount if you turn off “File Status Auto-Detection”:

I learned that a script run by crontab can’t have a relative path.
This fix was here: http://stackoverflow.com/a/10422444
The following example opens my_file.txt in a path relative to your script:
import os
dir_path = os.path.dirname(os.path.abspath(__file__))
with open (os.path.join(dir_path, 'my_file.txt'), "r") as myfile:
mytext = myfile.read()
http://stackoverflow.com/a/9980160
Turns out that you can use ELSE after a FOR loop to make it give an output if it didn’t have anything to iterate.
I followed these instructions to gitignore an already committed file: http://stackoverflow.com/questions/6535362/gitignore-after-commit
When I wanted to start tracking it again, I needed to following these instructions: https://gist.github.com/laszlomiklosik/3833968
Make sure you save a backup of your current version before you check out the file again.