You can make both mobile Chrome and mobile Safari display a native app install banner. The banner suggests that the user installs an app that is related to the current...
...page. It is shown in the phone's native UI. See attached animation. There is some fineprint you need to read to make this work (see below). References Android: Increasing...
Observed on Rails 2.3 and machinist 1.0.6 Like the title says, when you define the method empty? like in the following example, you may not longer use collection.make.
The Node Version Manager allows installing multiple NodeJS versions and switching between them. By default, it does not automatically switch versions when entering a directory that holds a .nvmrc file...
...COMMAND feature. So here is my take on it. Note that it is much shorter, it probably does a few less smart things, but has been working great for me...
The flip-flop operator is a hotly contested feature of Ruby. It's still struggling to find an idiomatic use case, except for a few very rarely needed things. It...
...s not something you'll likely reach for on a daily, weekly or even monthly basis. The only thing you really need to know about it is what it does...
TL;DR: Pannellum is a small (~56 kB, own WebGL renderer, no three.js) equirectangular panorama viewer. The npm package has no ES module export - importing it runs an IIFE that...
...assigns the API to window.pannellum. Bundle it statically, make sure the viewer's container gets a definite size, and allow blob: in your img-src CSP. Considered Photo Sphere Viewer...
...you have files in your .gitignore they won't be considered for changes, but still you might want to get rid of them, e.g. because they clutter your file system...
...While a regular git clean will ignore them as well, passing the -x switch changes that: git clean -x If you want to see what would happen first, make sure...
...toggle an outlining of HTML elements quickly. This helps greatly when you want to see the actual dimensions of elements, e.g. for floating elements inside containers, instead of opening up...
...shortcut (Shift+G for the 9.2-compatible layout or for the default layout with enabled "single-key shortcuts") and select "Outline" from the View → Style menu (needs to be done...
The program 'foo' can be found in the following packages: * foobar * barfoo Try: sudo apt-get install -bash: foo: command not found But you can customize this with the...
...connected with ssh. Because I'm using $@ I can also use options like a custom ssh-port...
Angular's location provider stalls links to the current URL, i.e. window.location. As soon as the $location service is activated in an Angular app, it will intercept links. The click...
...your interaction with the browser history (i.e. you're just using Angular as JS sugar on your page), Angular will create the above issue as soon as you use anything...
This is an attempt to list some of those things: On the server Always optimize: Don't do stupid things with the database. Avoid "n + 1" queries. Don...
...Use form models. Optimize on demand: Don't optimize without knowing what's actually slow. Measure first, for example by using a performance monitoring tool like NewRelic, Scout, AppSignal, Skylight...
If your shell seems frozen You probably pressed Ctrl-S which stops the buffer. Try Ctrl-Q to resume. If your shell behaves strangely (no input being displayed, strange character...
...Try typing this, followed by pressing the return key: reset That should clear the screen and reset output settings etc...
...have a README that gives the reader a quick overview of the project. Its size will vary as projects differ in complexity, but there should always be some introductory prose...
...for a developer to read when starting on it. Purpose That's already the main purpose of a project README: Give a new developer a quick overview of the project...
When navigating back to a page that was received from a POST request, undesired side effects may happen. Therefore, modern browsers try to keep users from doing so, i.e. Firefox...
...an error page explaining what's wrong. If the user presses "Try Again", it shows an additional alert asking whether the user is certain. Solution If you need to circumvent...
...response includes caching headers like Expires or Cache-Control, their validity depends on the server's Date header if present. Otherwise, the browser uses its local time. This can lead...
...for authentication. The cookie for this feature might include an Expires attribute, specifying its validity: Set-Cookie: remember_me=abc123; Expires=Fri, 15 Dec 2023 12:00:00 GMT
When searching for text in a MySQL table, you have two choices: The LIKE operator FULLTEXT indexes (which currently only work on MyISAM tables, but will one day work on...
...InnoDB tables. The workaround right now is to extract your search text to a separate MyISAM table, so your main table can remain InnoDB.) I always wondered how those two...
...an error in the User#name method) you will end up with a confusing stacktrace that looks like you have an error in your render call. If this happens to...
...you, temporarily remove the annotation to see the correct error. Niklas opened an issue in rails, a fix is merged and will arrive in Rails >7.2.2.2 and...
xterm by default uses black text on white background. To change that to something like "light gray on black", do a vim ~/.Xresources ...and put this in there: xterm*background...
xterm*foreground: lightgray Afterwards, feed these changes to your current X session: xrdb ~/.Xresources Any subsequent xterm will be colored white on black background. Hint: While you're at...
bundle open BUNDLED_GEM will open the BUNDLED_GEM's source code in your default editor...
Back when Steak was first released, Capybara didn’t have any of the nice RSpec helpers it does now. A lot has changed since. Besides the helpers, it got its...
...own RSpec acceptance testing DSL recently, essentially eating Steak’s functionality and turning it into a complete acceptance testing solution (on top of RSpec...
...you will build features on top of an LLM API. Both come with a security story — and it's the same word, prompt injection, describing two different attacks. This card...
...an agent — training against injected instructions, untrusted-content handling, auto mode's command review, sandboxing — and why your own review of the agent's actions is the layer you control...
An alternative could be to use the MySQL Docker image which is still updated for 5.6. Ubuntu 16.04 only provides packages for MySQL 5.7 which has a range...
...list of official APT repositories for MySQL 5.6, but those repositories do not yet support Ubuntu 16.04. However, the 15.10 repos will work for 16.04. I would not recommend to...
We recommend configuring Selenium's unhandled prompt behavior to { default: 'ignore' }. When running tests in a real browser, we use Selenium. Each browser is controlled by a specific...
...driver, e.g. Selenium::WebDriver::Chrome for Chrome. There is one quirk to all drivers (at least those following the W3C webdriver spec) that can be impractical: When any user prompt...
This StackOverflow question about nested function definitions in Ruby imparts a good understanding of Ruby's def...
When you do something like this in your code: def var_value @var ||= some_expensive_calculation end Be aware that it will run some_expensive_calculation every time you call...
This illustrates the problem: def some_expensive_calculation puts "i am off shopping bits!" @some_expensive_calculations_result end When you set @some_expensive_calculations_result to nil...