Heroku isn't updating my CSS and JS - css

First thing I should mention is that I'm NOT using Rails. I don't have a rake assets:precompile task (tried it anyway, didn't work). I don't have a public/assets folder either (tried git rm -r public/assets anyway, also didn't work).
For a long time, I was using Dropbox to deploy to Heroku (I'm quite the newbie to code) - I was planning on moving to git in about a month or so. But given this issue, I made the move today and tried pushing through git - also didn't work. i.e. I did a git pull, settled all the conflicts and then did git push. Still nothing.
Basically, Heroku isn't loading any of my new CSS and JS. It detects the files just fine. Running git push now says everything is up-to-date, running git status says there is nothing to commit. But using Chrome's inspect tool, the JS and CSS files don't have the new code I wrote.
I also tried adding the gem rack-flash-session to my Gemfile and requiring 'rack/flash/test' in my application_controller - this actually crashed the whole app and I removed it.
I also tried installing the heroku-repo plugin and running heroku repo:purge_cache --app my-app-name but that also didn't work
Running the code locally, everything works fine. It's just the online version that's failing.
I updated the Heroku CLI just before trying any of this and (you guessed it!), also didn't work.
I don't know what other info you'd need, so let me know in the comments and I'll be happy to provide them :)
Any help is appreciated!

Refresh the page with control + shift + r. This will clear the client-side assets cache and get the newly updated ones. You could also look for a gem that does cache-busting "asset fingerprinting" - this is a unique string that's appended to the asset files which prevents browsers from using a stale copy. I searched a little but I can't definitively point you to something that works with sinatra. Maybe you'll be able to find a gem that works though.

Related

How to run angular 2 application?

I have downloaded angular 2 application from this link:
https://github.com/aravindfz/firstAngular2App
How to run this application?
Which angular cli version install to run angular 2 application?
I tried from some questions stackoverflow but not working properly.guys this question is not duplicate..Please understand.
Anyone can give clear details?
I need step by step procedure.
If you cloned the repo and did nothing else, there are a few things you need to do before you can run the app. Since I don't know how much web development you have done, I'm going to include things some people will think unnecessary.
Install node.js, if you haven't yet. Grab the LTS release from https://nodejs.org/en/. Do not use the "Current" version, because that may not be compatible with Angular just yet. If you have and older version of Node, upgrade. If you already have the LTS version, skip this step.
Now open a new command prompt or terminal and change to the directory where you cloned the repo. To be sure you're in the right place, make sure you can see a file named package.json.
In this command prompt/terminal window, execute this command: npm install. This will download and install all the dependencies (which could rather disturbingly add up to a few hundred Megabytes). You may experience timeout errors if you're behind a corporate proxy server. That's not something you can fix as of 2018. Just connect using something else and try again.
Once everything is installed, you should be able to run the Angular app. Everything I mentioned already only need to be done before you run it the first time. To ensure you are in the right folder, navigate to where your index.html is located and run this command: ng serve. If ng cannot be found, you may need to install it. To do so, execute npm install --save-dev #angular/cli. Now it should work. If not, close your command prompt/terminal window, open a new one and try ng serve again.
Once ng serve is finished compiling, you should be able to view your app by opening http://localhost:4200 in your favourite browser.
And that's it!
Here's a bonus tip: Take the time to work through the official Angular Quick Start. It really is a fantastic guide and will get you skilled up much quicker than just hacking it ever will.
Good luck.

Root on Android Things userdebug builds

In my Android Things app, I need to use su from runtime. However, Android Things system is built as userdebug build, so I can only access it from adb. I tried to both replace su binaries with no luck. I tried to disable ro.secure by unpacking and repacking boot.img, however flashed system still returns getprop ro.secure 0. How can I achieve root in my Android Things device?
I had these scripts working on a quite early preview version, maybe 0.1 or 0.2. https://github.com/fmatosqg/androidthings_ndk/tree/master/app/src/main/script
Although I had to run it manually, there should be a place where I can add this script so it runs every boot, just like linux's /etc/rc.d
I don't remember how I got the script to work, but the idea is that one script simply exists to launch the other running as superuser, similar to what you would expect with sudo <insert command here>

Meteor error - promise.js

I have a reoccuring problem with my meteor applications that has caused me to delete and redo all my projects. The problem is that whenever I go to start up my app with meteor run or meteor it shows this error:
I had this problem with another one of my app and it required me to uninstall meteor and reinstall it for it to work..I was wondering if there was any other way to fix this problem. Many people have said delete you .meteor folder or .meteor/local folder and start it up again but that has not worked for me. Another solution that has worked for many people except me is the command that you run inside your application rm -rf ./.meteor but I have no luck with that. I don't know what to do at this point in terms of fixing my problem. and I do not have a problem with my code, as it was working about 2 days ago and I haven't touched it since.
I have:
Windows 10 Pro.
64 bit operating system(I don't know if that matters).
Meteor v1.5
Stuart,
Deleting the .meteor folder isn't a good idea, because it contains the list of packages, and your project won't work at all then.
You can delete .meteor/local, because that is basically its temporary build area. Another thing you can do it delete the node_modules folder, or type npm rebuild which tells npm to rebuild the node_modules directory in case there is some corruption in there.
meteor reset will clear out your database in case that is the problem.
You can delete~/.meteor, where ~ is your home directory. Meteor will rebuild it.
As for the screen shot, it's better if you can paste the actual text here, because I can't tell what that character is it's complaining about. Remember to click the button with the braces to format it correctly.
Hopefully one of the above will help you. Otherwise perhaps you could share the project?

Meteor File Change Watcher is taking too long to recognize changes

My Meteor file change watcher is taking forever to detect my file changes and refresh the browser, sometimes even longer than a minute. This makes developing a real pain.
My Meteor is running inside an Ubuntu-VM. The projects folder lies in my OSX and is mounted inside the VM. So I'm aware that inotify/kqueue won't work, so Meteor should fallback to stat polling.
I even set the environment variables according to this post, but the behavior is still the same.
METEOR_WATCH_FORCE_POLLING=true
METEOR_WATCH_POLLING_INTERVAL_MS=500
Is there any way to fix this annoying behavior?
The folder from OSX is mounted as a nfs share btw.
Update:
I did some testing and there is no difference if the application has a big amount of packages or is taking long to build, even with the very basic app you get after meteor create I still get the same behavior.
If I change a file in the VM (so that inotify works) the refresh is happening instantly.
I've have apps in production that incrementally become slower when adding packages, both 3rd party and private packages. I also discovered that adding 3rd libs directly on the client/lib increases the reloading time.
I'm not sure if Meteor 1.0.2 actually solved the problem of watching the directory efficiently.
What version of Meteor are you using?
Much of this lag-reloading issue was addressed on Meteor 1.0.2. While it still takes some time, I would say was ~5x faster on my experience.

Sluggishness with WebStorm and Meteor?

So, I'm working on a Mac Mini, using WebStorm to fuss with Meteor apps. I'm finding that WebStorm tends to get sluggish, and is constantly trying to index things. I have 4 gigs of RAM, of which 791M seem to be allocated to WebStorm at any one time. My disk drive is 500GB, and I make sure there's always at least 20% to 30% free space.
So, a few questions... is it Meteor's bundle process that's causing WebStorm to do the indexing? Is there any way to optimize the indexing? Make it run less frequently? Ignore the .meteor directory, perhaps? Is 20% of available RAM an appropriate amount to allocate to WebStorm for Meteor development? Are there any other things that people can recommend to optimize WebStorm so it's not so sluggish?
Thanks in advance for any recommendations!
As #Martin said - exclude the directories where Meteor stores it compiled files: .meteor\local and .meteor\meteorite (when using meteorite).
To have Meteor suggestions / ... add the Meteor source as an external library: /usr/lib/meteor/packages/. I'm using PhpStorm as well and add the path to the PHP include path (doesn't matter it's not a PHP-library).
When adding it as a JavaScript Library in the project settings the directory structure gets lost and you have to repeat this when upgrading meteor.
I'm using PHPStoem for my meteor development and I am having the same issue as you do. I guess the engine in PHPStorm is identical to WebStorm...
I'm unsure if increasing the amount of RAM available to the IDE actually will have any effect. The issue is related to the IDE re-indexing the folder-tree whenever changes are made to any file(s) in the tree.
When meteor is running and changes is made to a file, meteor is bundling the whole application into the .meteor folder why the tree is re-indexed.
I haven't tried it out yet, but I guess what actually will help is to add the .meteor-folder to the ignore list so it wont be re-indexed every time a file-change happens.

Resources