I just pushed omniauth-central_login
to rubygems.org, to make it easy to integrate CentralLogin with other ruby apps. It is a companion gem to CentralLogin, a batteries included open source OAuth2 Provider based on Rails, Doorkeeper & Devise, with simple user managment tools.
Add this line to your application's Gemfile:
ruby
gem 'omniauth-central_login'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install omniauth-central_login
Configuring Omniauth:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :central_login, ENV['CENTRAL_LOGIN_CLIENT_ID'], ENV['CENTRAL_LOGIN_CLIENT_SECRET'], {
scope: "openid email profile",
client_options: {
site: ENV['CENTRAL_LOGIN_URL']
}
}
end
Configuration for Devise (using omniauthable):
co...
A simple OAuth provider. See below for more information, or check out the source of CentralLogin on GitLab. To integrate it with your ruby-apps, use the omniauth-central_login
gem.
This app builds on the foundations of the Doorkeeper, Doorkeeper::OpenidConnect and Devise to provide a central login system.
While Doorkeeper supports other OAuth flows, CentralLogin focusses on OpenID Connect as it is a more complete, and hence useful standard, for most use cases where you want to support authentication & authorization.
This project builds on years of juggling with different authentication providers and implementations. It may cut corners to be a pragmatic and less flexible solution which you can host on your own. You don't have to tie your users to a closed authentication system such as Auth0, Azure Directory, Cognito (the horror, really, stay away from it) or something else. In the past I've been a happy user of Keycloak, which is definitely way more advanced than this project, but it in the end it is a Java application and hence harder for me to maintain and not focussed on what I think are the core requirements :)
So, are you in the market for:
Ever had the problem that you reuse the same project for a managemable number of clients? Too few to store branding materials in a database, but more than one making it hard to keep separate branches in sync?
Introducing BrandingRepo (for Rails)
The idea is simple: create a configuration file with those files that are specific to different brands/customers and store their mods in a different repository. Repository is quite a big word here: we simply create a config/brands
folder in your current branch where you can push and pull your brand specific adjustments from. All managed in the same git repository.
What it is not:
Add this …
Inheritance is considered bad practice for quite some time now (Gamma, Helm, Johnson & Vlissides, 1994). Little did I know when I started the ‘workbook’-project in 2012 (note that I don’t have a computer science background).
The main reason I wrote this workbook-gem was that I wanted the most predictable API for working with spreadsheet data (acting as arrays of arrays), not having to use a different API when reading XLSX or CSV files, nor when writing it.
After learning that inheritance is not always a good thing, I still often thought of a workbook
as an array of arrays and hence an exception to the rule. But then I came accross a helpful post by Avdi Grimm: [Why you shouldn’t inherit from Ruby’s core classes (an…
When developing full stack webapplications, I typically use Rails. While Rails is the perfect system to create CMS'es, for sites that are less applications and more websites CMS-gems for Rails may help.
Webpacker is still opt-in for new Rails projects. But this might change. The JavaScript ecosystem is moving fast and new JavaScript frameworks are pushing customer’s expectations to higher levels. To use these frameworks with your Rails app, you had a few options:
npm
or yarn
into the asset pipeline yourselfI have been using rails-assets.org the past few years to keep my JavaScript dependencies up to date. It thought it was smart solution; instead of requiring individual developers to maintain Gem-wrappers, Gem wrappers are created on the fly by RailsAssets.org. It was smart and light weight on the developers side and worked perfectly with the Rails' Asset p…
Just a small note that I've made some improvements to my SocialLinker-gem lately and while I've been using it on a few sites already, I wasn't using it on my very own blog. Today I found some time to change exactly that: you've got to eat your own dog food. If you want to have a taste of it: murb/social_linker (if you're a ruby-dev) or just click the share icons below :)
Image CC-licensed BY: Sh4rp_i
I had a few projects that I thought could use some share 'buttons', but I didn't like to include the JavaScript loaded and privacy invading share buttons that the networks try to sell you by default. Neither did I like to concatenate the links with all variables required for each project… so I wrote a small rubygem on a back and forth train trip (#ilovetrains ;)): social_linker.
The idea is that you share something about a certain subject, hence you initalize the SocialLinker::Subject
and then you'll be able to generate share links from it:
subject.share_link(:facebook)
Initialize the subject with enough material to generate links from, such as the page's url, maybe the media url (mainly for Pinterest type-shares), a description, tags etc.
For example, initialize the SocialLinker::Subject
as follows:
social_linker_subject = SocialLinker::Subject...
LinkedIn confronteerde me onlangs nog met het feit: murb bestaat alweer 6 jaar. Een goed moment om verder te gaan met terugblikken op de opdrachten van weleer.
De belangrijkste opdrachtgever in mijn beginjaren was de ING bank. Een belangrijk product dat ik in de begintijd aldaar heb gebouwd is een database op basis van Excel-bestanden (iets dat ik ooit nog wil(de) uitrollen als 'AxlBase'). Zoals ik eerder al schreef, soms moet je een bestaande werkwijze omarmen. Wat is het precies en van waaruit is het ontstaan?
Een database op basis van Excel-bestanden. Niet echt in technische zin (achterliggend is het een traditionele database), maar wel in de praktische zin. Excel is hét bestandsformaat van de gewone kantoormedewerker voor gestructureerde data. Het wordt veelvuldig gebruikt in allerlei projecten. AxlBase is in staat verschillende Excel-bestanden per o.a….
workbook
is simple ruby framework for containing spreadsheet like data in a datastructure that is known to most programmers: the (multidimensional) Array
.
News
murb bestaat inmiddels een aantal jaar, daarom lijkt het me leuk om de komende blogposts een aantal mooie resultaten te delen. Als eerste in de rij: Het Concordia Weekoverzicht.
Concordia, een culturele instelling in Enschede, brengt iedere week een weekoverzicht op A5-formaat uit. De weekoverzicht tool die ik voor hen heb gebouwd maakt het mogelijk deze zonder veel moeite wekelijks uit te draaien.
Tot zomer 2015 was het maken van het weekoverzicht een repetitieve handmatige invuloefening met dure en ingewikkelde Adobe software, terwijl de meeste gegevens keurig waren opgeslagen in hun ticketsysteem en de kijkwijzer-database. Het voordeel van de Adobe-pakketten was weliswaar oneindige mogelijkheden qua opmaak, maar in de praktijk was het eindproduct telkens vrijwel hetzelfde. Ondertussen koste het handmatig opmaken dus relatief veel tijd en kunde.
Het volledig automatisch genereren van e…
For a project I'm working on, I decided to develop some functionality in a separate gem, so the project doesn't get cluttered too much with special librarly like classes. And since I like open source, I've got something to share with you.
We were dealing with the following situation:
Given a set of the following keywords: "aardappelen", "zachtkokende aardappelen", "zout", "schimmelkaas", "kaas", "oude harde kaas", "kikkererwten", "maïs", "bruine bonen", "shiitake", "boter"
Can you recognize:
"een grote pan zachtkokende aardappelen met een snufje zout"=>["zachtkokende aardappelen", "zout"],
"schimmelkaas" => ["schimmelkaas"],
"(schimmel)kaas" => ["schimmelkaas"],
"old amsterdam (maar een andere oude harde kaas kan natuurlijk ook)" => ["oude harde kaas"],
"g (verse) shiitake in bitesize stukjes gesneden" => ["shiitake"],
"pot hak bonenmix (kikkererwten maïs kidney en bruine bonen) afgespoeld en uitgelekt" => ["kikkerwerwten", "maïs", "bruine bo...
In a previous post I described how simple integrating elasticsearch is with Rails for beginners. You could've been happy with the fact that you now have implemented full text search, but that too basic set up probably doesn't work that much better than adding a column to your model, throwing in all text in it and running a LIKE query (although elasticsearch does try to rearrange the results a bit).
In this post I will learn you two things that makes elasticsearch worth it.
Analyzers add some fuzziness to your searches. First, make sure your analyzer is in the right language, this will improve your results. You add the following bit to your model (I typically place it just below where the scopes and validation are defined).
settings index: { number_of_shards: 1 } do
...
Dit artikel van murblog van Maarten Brouwers (murb) is in licentie gegeven volgens een Creative Commons Naamsvermelding 3.0 Nederland licentie .