recentpopularlog in

kme : routing   18

Helper to list routes (like Rail's rake routes) | Flask (A Python Microframework)
Only thing is "url = url_for(rule.endpoint, **options)" will generate an error if you have one of your inputs restricted to an integer input type. I just handled the one URL parameter that took an int specially--a kludge, but it worked.
flask  routing  snippet  likerails  solution 
january 2017 by kme
routing - How to serve static files using Klein.php - Stack Overflow
Another Option

One final thing I should note. If this is what you're really trying to do, rather than a simplified example, you may be able to accomplish the same thing with Apache mod_rewrite, or the equivalent in Nginx, and have better performance, since you're not executing any PHP code at that point. On the other hand, if you want to do something more advanced, like checking the user's login credentiails before deciding whether to serve the file, or serve files outside your document root, the way you're doing it is probably spot on.

I'm not very good at writing mod_rewrite rules, but I think you could do something like:

RewriteRule ^/web/(.+) /your/desired/path/$1 [R,L]

assuming the destination is web-accessible. Reference:

Or, if it's not web-accessible, it looks like you could setup an alias:
apache  rewriterule  redirection  statichtml  hosting  webserver  webmaster  webdevel  php  routing  altorouter  solution 
june 2016 by kme
Dragon Dictate + Bluetooth. Just need a better mic? - headset dictation mac | Ask MetaFilter
There is a work-around that is working really well on my new iMac:

Download and install Line In and Soundflower.
Connect your headset to the computer's Bluetooth connection without the dongle.
Open Sound Preferences.
Select your headset for both the Input and Output as the headset. (That way you can hear the computer if you have set it to speak to you or you are listening to music &c.)
Open Line In (You will be using it a lot, so you may as well set it to stay in the dock.)
When you open Line In, a window will pop up that gives you options of "Input From" and "Output To".
You want to set the Input from your headset.
You want to set the Output to "Soundflower". I am using the 16 channel setting because it works. This is so rigged up that I don't want to try the 2 Channel and ruin things.
When you set up the profile in Dictate, you will then choose "Soundflower" in the list of microphone inputs. You should then be able to trick it into thinking that it is a valid (to them) device. Make sure you are selecting the same one (either 16 or 2) that you selected as the output in Line Out.

Other options: Plantronics Calisto
mac  osx  audio  routing  dictation  dragondictate  usb  headset  bluetooth  annoyance  solution 
january 2014 by kme

Copy this bookmark:

to read