How to upload only thumb image folder under system directory using paperclip in ruby on rails - paperclip

I have 5,00,000 Images to be upload using paperclip plugin. it will take more space that is, 9GB. but, i need to create only thumb folder under public/system/photos/1/thumb without original folder. How to figure out this issue?. please help me.

Did you try the answers suggested here: How do I tell paperclip to not save the original file?

Related

Repack extracted .img file that I just extracted with binwalk

I used "binwalk" to extract an image file and I got what I needed as a directory hierarchy. So I made my changes and now I want to repack it and get the .img file back out of it.
Is there a solution?
I found a solution to accomplish this, I used imgRePacker_203 to get my image extracted.
If you could not find imgRePacker_203 online, then I have created a Git repo on my Github account and I included that tool with many other tools related to work with .img files. Also there is a very useful video on which you can get all links here:
https://github.com/AhmadVakil/Image-file-tools
https://www.youtube.com/watch?v=3zm91DfdkIo
Note: This solution is worked with ALLWINNER, and Whatsminer image that upgrade or downgrade the firmware of ASIC miner's control board. Hope you find it useful for other problems and extracting other images.

How to make Sass watch css if files are being edited on the server?

I understand how to make a sass file watch a css file through the terminal.
But this is only the case when the files are on my computer.
How to set up the same process if I'm editing files directly on the server.
When creating a website (I'm loading the files from the server on Sublime Text3) and I don't have any files on my computer and I don't want them on my computer either. I have no idea how to make sass watch my css file if the files are loaded directly on my text editor and saving everything directly on my server (so without saving anything on my computer).
If this is done through the terminal or any other way,, how is this done?
After many hours and having squared eyes now, I managed to find a blog with a solution.
Here is the blog:
(1) . http://blog.omgmog.net/post/getting-started-with-using-sass-in-your-existing-website/
Long story short: I got it to work and to do what I want it to do! smile
I went through the steps as mentioned in the blog. In order to make it work I had to download a php file, which can be found here: (2) . http://leafo.net/scssphp/
In addition I had to create another php file and add some code into it (which can also be found in the second link).
Afterwards I had to link to the php file I had created and specified the .scss file to load (normally you don't link it to any php and you would specify it to the .css file).
The blog in link one explains everything in clear steps. Hope this helps others as well as I didn't see this question being answered anywhere before on StackOverflow!

qt jpeg images not showing on deployment (already added the plugins to the directory)

I am using Qt Creator 5.3 but any Jpeg images that I put into the build so not show up when I launch my exe. I got it working before by putting the necessary plugin dlls into the directory but now i still have this problem. In my research the only answer I found was to put the plugin dlls into the directory (which i already did) thank you.
add the image files to a resources file. It is very efficient and it is also cross platform. check out this link http://qt-project.org/doc/qt-4.8/designer-resources.html

Uploaded to S3 with HAML files

I am super web development noob, and I HAML instead of regular HTML files. I went through the steps to upload to S3, and everything worked fine with the test index.html file, but when I uploaded my HAML files, nothing worked. I created the files with Middleman, if it matters. I know this is a stupid question but I looked around for a long time and didn't find anything. Thanks in advance!
Seens like him is using a blog system like jekyll or others, well, since you write the pages with haml, i guess you have a option to process these files and generate the static html files.
Add
set :haml, :format => :html5
to your config.rb. You may find this site helpful

Accessing an external file from MacRuby

I have done several small scripting/automation projects before but this is my first time using MacRuby and I couldn't find out at all why my project is not working.
This task would have been easy to fix if it was just a plain Ruby script. However, it needs a Mac GUI so I decided to use MacRuby for its Cocoa bindings.
The app itself is a simple form that will perform a calculation based from some data from an external CSV and some text fields and then show the results of the calculation.
My problem is that this code does NOT seem to work:
#arr_from_csv = CSV.read("data.csv")
Upon building the file, I get the following error:
[...]/ruby/1.9.2/CSV.rb:1335:in `open': No such file or directory - open() failed (Errno::ENOENT)
At first, I thought that I must have put the CSV file into the wrong directory inside XCode project's folder structure. I tried putting on the same folder as the script itself (app_delegate.rb). Didn't work. I tried putting it in the Resources folder, still didn't work.
Then, I decided to just use an absolute file path. So, I changed to code into:
#arr_from_csv = CSV.read("~/data.csv")
and copied the file into my home directory. It still can't read the CSV file.
Am I missing something? I'm sorry, this is my first time using MacRuby.
Thanks.
You should change the code to "/Users/xxx/data.csv".
Ruby does not expand "~" to "/Users/xxx".
Notice: xxx represents your login id.
I was able to solve my problem by using:
#arr_from_csv = CSV.read(File.expand_path("~/data.csv"))

Resources