FSH Sweden AB

You can't turn when falling

The problem with Rails Asset Pipeline that I always stumble upon

You know how it is, you develop using Rails and it is going great! Tailwind and downhill, you develop with an amazing speed. Then when teh app is starting to get really useful, you say: ”hmm maybe I should run… Fortsätt läsa →

Rails and Devise – Login using either username or email

This is essentially a no-nonsense step-by-step description of the most common case from: https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address 1) add a field to the User table rails generate migration add_username_to_users username:string:uniq 1b) check that the migration does: 2) apply the migration rake db:migrate 3)… Fortsätt läsa →

Javascript in 2017

The JS environment is, as we know, ”complicated”. Every browser uses a different JavaScript engine: Chrome runs V8, Firefox runs SpiderMonkey, and Internet Explorer uses Chakra. Each implements a different subset of ES2015 features. There are also multiple Javascript versions… Fortsätt läsa →

Moving the MySQL data directory

Has this happened to you? You run for a while on the default installation of MySQL. The data increases and suddenly you realize that the system disk (a fast SSD of 256 GB) wont suffice. OK, we need to move… Fortsätt läsa →

How to setup a Raspberry Pi as a NAS using Samba

http://www.simonthepiman.com/how_to_setup_windows_file_server.php

Capistrano!

How to deploy a Rails 4 app with Git and Capistrano

Calculating Historical Volatility

Historical Volatility shows how volatile an asset has been. There are numerous ways of calculating it, and I will show the most simple one here. Here’s how you calculate it using Excel or LibreOffice Calc if you so will. *… Fortsätt läsa →

The Builder Pattern

I won’t even go into why you should learn patterns. Patterns are canned knowledge! One of the fundamental ones are the Builder pattern. It’s create to help you avoid situations like: p = new Product(”STK”, ”XX”, ”TSZ”, 10.0, 11.33, 12.0,… Fortsätt läsa →

Adding Stripe Payments to your Rails application

If you need to process payments, for example charging the user for using your great new website, Stripe is a great contender. An alternative is PayPal, which I will write about later on. The Stripe APi documentation is great, however… Fortsätt läsa →

Setting up 1000 Devise user accounts using fixtures

Seting up a one Devise user (version 3.5.1 and later) is simple in file <app>/test/fixtures/users.yml: tom: id: 11 name: TestUser email: test@example.org encrypted_password: <%= Devise::Encryptor.digest(User, ‘password’) %> If you want to setup 1000 users, use some ERB code instead. <% 1.upto(1000) do… Fortsätt läsa →

« Äldre inlägg

© 2017 FSH Sweden AB — Drivs med WordPress

Tema av Anders NorenUpp ↑