Copy directory before update and import after compile. - heroku

I have an assets folder in the environment where pictures are uploaded, is there a way to copy this folder and import it after the image has compiled?
Or can I somehow use a folder outside of the image instead?

This is what Docker volumes are for: http://docs.docker.io/en/latest/use/working_with_volumes/
Be sure to have a look at other concepts in the documentation as well. There is some great stuff there ;)

Related

Best way to make fake path in linux?

Working part: I have folder with images for my website, but for local purpose, it is not necessary to show real images. I wrote php script, which serves fake image only with text of whole demanded path, script is located on root of image folder and activated for everything by .htaccess.
The other part - making thumbnails by php script is working directly in filesystem, so Apache does not affect these - and I have problem with non existing folders, files, etc. Is there some nice way to make similar fake path directly in filesystem?
I'm using docker image for this problem, so I'm able to do everything inside this image.
I'm avoiding to make changes directly in the scripts, because of temporary situation of server changing (change the path to serve over apache etc is not possible).
Thank you for your advice :).
You could create a linux softlink directory:
ln -s file1 link1

How could I copy a package from the golang source to hack on

I want to basically copy the parse and template packages from the golang source: http://golang.org/pkg/text/
I want to be able to just play around wit the code and hack on it for fun and learning etc.
Can someone tell me how to go about doing this?
Could I just copy the package folders and then somehow move it to my own package like:
$GOPATH/src/github/user/parse
$GOPATH/src/github/user/template
Is this a safe way to do this? How will it build?
Yes, you can just copy the folder like you've described.
When you import it in your application, you just use your new import path:
import (
"github.com/user/parse"
"github.com/user/template"
)
It is completely safe to do that. Just Go ahead and code!
Ps.
I assumed your path would actually be:
$GOPATH/src/github.com/user/parse
since the domain (.com) will also be included in the go get path if you use github to host your package.
Ps2.
Remember to update the imports in the github.com/user/template package to refer to your new parse package instead of the original one.

How to handle Bower components images, fonts or other assets (with yeoman)?

I'm building a webapp using yeoman. Everything is great except the fact that I'm getting a bit confused with using assets (like images or webfonts) that are bundled with some bower components (sass-bootstrap for example...)
I include javascript assets using Requirejs, but my main problem lies with the images and fonts... What's the right approach? Can't seem to find it anywhere... Should I copy all the font files to the font directory I use with compass? Those files wouldn't be updated when the bower component is updated...
Any help would be welcome!
Don't copy, use your bower_components directory as another assets directory like scripts or styles. Link to it in your requirejs paths, and link to it in your compass config.
If you want, during your build you could look into your bower folders and copy all images and/or fonts into other subdirectories in your dist location.
You made a good point, copying source files won't get updated when you update. That's why you want to try as hard as you can to just leave them as is.

Resource not being bundled into app

I have shaders named basic_shader.vsh and basic_shader.fsh. I added both of these two files to the Copy Bundle Resources build phase. But they are not being copied into the bundle app. And they don't appear in the Log Navigator. Xcode builder effectively ignores them.
They are located into a directory outside the source directory. I don't know if that is relevant. The funny thing is that a png image also located outside the source directory is being copied inside the bundle. My app is a Mac OS X app using Cocoa.
I solved by adding into the Copy Files build phase (setting the destination to Resources) instead of the Copy Bundle Resources build phase... I don't know why it solves the problem as I don't really understand the problem, actually...
Thanks anyway...
For some reason .metal files are not regarded as resources. If you just change the extension to anything else they're copied in the bundle.
Make sure your shaders are copied into your resources

import images into an intelliJ Java project

I am working on a Java project that requires the use of several images. I'm on ubuntu linux So I have an images folder inside my src directory. So far so good but try as I might I can't seem to find a way to load or import image files into that images folder. ( I want to be able to simply go something like loadImage("images/imageToLoad.png"); )
I have tried to just drag and drop. I know that I could of course leave the program and use the linux filesystem to transfer the images but that's a pain and defeats the purpose of an IDE.
You will have to do it in a file manager, outside of IntelliJ IDEA. To ensure that images are available in the application classpath check Settings | Compiler | Resource Patterns, .png extension needs to be listed there.

Resources