RGB color picker for Rails 3 - ruby

Status: I am building an app in which is needed to be a field available for user to select a color, this field will contain RGB color code string.
I have tested one which looks pretty but it does not work very well. It is 'picky-color' and it is hosted in this repository: https://github.com/Astorsoft/picky-color. Here I open an issue about some problem with it.
Problem: Please suggest me some color picker to use in Rails 3 app.

Perhaps the list on the page jQuery UI Development: Color Picker gives you the one that works out of the box. The reason for that is that jQuery is now included in Rails 3 applications, so using something on the base of Prototype or another JavaScript library is more difficult.
The integration in ruby should not be difficult, though.

I selected jPicker, It was a good option for me.

Related

How to use url image inserting dialog instead of upload in CKEditor 5 Classic

I want to use CKEditor 5, insert image with URL dialog, instead of its default file upload dialog. how to do this in CKEditor 5 Classic?
There is, as far as I know, no such feature officially provided.
There is, however, a tutorial provided in the documentation on how to write such a feature: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/creating-simple-plugin.html
There is also a separate project on github for the same purpose, which appears to be a bit more stylish: https://github.com/khanhna/ckeditor5-image-via-url
Both approaches require to configure a modified build, and both appear to lack an important component: a button in the image's toolbar to edit that URL later on.
So, a more simple approach that does achieve practically the same is to just drag the images into the editor from some browser window.

How make a screen with fields in VSCode Plugin

How do I create a custom screen, with text fields and dropdowns for a plugin in VSCode, something like the settings screens I saw in some plugins, or like this Jira screen which is a form for adding a new issue?
That example is using the VS Code webview API. Webviews let you render arbitrary html in the editor, so you can create as complex a form as you wish. This example extension shows how to use the webview api.
For simple input cases however please try using VS Code's native input APIs, such as QuickInput

custom gallery from user phone

I want to be able to show the user images from his phone gallery, and pick one or more, the images should be displayed in 2 or more columns according to the user choice.
I looked for some plugins, and didn't find one that solves that problem.
Is that possible using conventional Android/iOS functionality?
If not, I could build a custom gallery for the user, but the question is- how do I get all the gallery names (Video/Camera/Screenshots) etc.) and file paths?
Tried to look in nativescript-imagepicker, but it doesn't seem to give me that functionality. Any help would be appriciated
If you like to customise the layout then you got to build one from scratch. You would have to use the native apis, MediaStore on Android / PhotoKit on iOS to read available image list and wrap them on your own layout.

CkEditor - how to change the look

I'm a pretty newbe at html, css, etc. etc.
I just downloaded the CkEditor and it works perfect. I use the inline editor replacing a textarea. Now I would like to change the look a bit
a) I would like to have the editable area with a different background color
b) I would like to have a thin line around the area
How can I do this? As far as I understood I need to manually change that in one of the css files - but where, and what do I need to put in there?
ALso I tried to configure the toolbar using the configuration tool and although I opted for the button "source-code" it won't show up? How can I manually include this in the toolbar?
Sorry, I know that these are very basic questions and I tried to search for answers on the forum (but the only things I found where some years old, and trying to duplicate what was posted didn't work... - guess it changed with the new version of ckeditor).

Automatically fetch preview image from given URL in Rails

I need help again from the community.
I'm interested to know how to extract a preview image from a given URL in rails.
Basically, it would be a functionality like you have on reddit. When user submits a link (fills in the link field in the _form), a preview image/thumbnail is automatically pulled from a given url. (I would like to save the link of the image as a field in the model, I don't want to save the image itself).
Is there a gem for that or? What's the best way to do it?
Thanks for the help.
There is a gem
github.com/gottfrois/link_thumbnailer
that does exactly what I wanted.
I tested it, and it works as described, so I can recommend it.
You can use some wrappers around PhantomJS:
PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
It's also known for its ability to make web page screenshots.
I found a couple of gems for you: screencap and webshot.
Example with screencap:
require 'screencap'
f = Screencap::Fetcher.new('http://google.com')
screenshot = f.fetch
You're also encouraged to check the documentation, it's pretty straightforward.

Resources