- Create file
connection.rb,notification_channel.rb,channel.rb - Install
redis
- Install deps with
npm i --save actioncablenpm i --save-dev @types/actioncable
See Medium forum 'include-vs-prepend-vs-extend' See Ruby simple command example
Test with irb
module BasicObject::SecondGigi; def banana1; 'banana1'; end end
module BasicObject::FirstGigi; def banana2; 'banana2'; end end
class BasicObject; include FirstGigi; prepend SecondGigi; end
class Gigi; endNOTE: Some of this may be unecessary, idk
sudo apt install inkscape imagemagick libcanberra-gtk-module libcanberra-gtk3-module canberra-gtk-module
# This function will generate a '.ico' from a '.svg' and it will mov to the requested path
You can expose a http port from a private network using caddy and ssh
Server must be a pc or a server with a static public ip and a nameserver.
| function get_html(){ | |
| echo $(cat $filename | sed 's/<!--.*-->//g' | sed 's/\/*.*\*\///g' | sed 's/\/\/.*$//gm') | |
| } |
| /** | |
| * Emit each element of array as single event. | |
| */ | |
| const array$: Subject<string[]> = new Subject<string[]>(); | |
| const each$: Observable<string> = array$.pipe( | |
| tap((v: string[]) => console.log('array', v)), | |
| switchMap((array: string[]) => merge(...(array.map((item: string) => of(item))))), | |
| tap((v: string) => console.log('each', v)), | |
| ); |
Try this in your rails console with rails c:
Sidekiq.redis{|r| r.get("stat:processed") }
some_data = Sidekiq.redis { |conn|
conn.pipelined do
conn.get("stat:processed")
conn.get("stat:failed")
conn.zcard("schedule")| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # All Vagrant configuration is done below. The "2" in Vagrant.configure | |
| # configures the configuration version (we support older styles for | |
| # backwards compatibility). Please don't change it unless you know what | |
| # you're doing. | |
| Vagrant.configure("2") do |config| | |
| # The most common configuration options are documented and commented below. | |
| # For a complete reference, please see the online documentation at |
Post.transaction do
# This one is ok. Returns true.
@post.attachments.attach(io: StringIO.new("something...."), filename: "new-post.txt", content_type: "plain/text")
# This would raise ActiveStorage::FileNotFound error.
# Plus, you won't find any new file in the filesystem until commit.
# @post.attachments.last.download| # Add Docker's official GPG key: 1 | |
| sudo apt-get update | |
| sudo apt-get install ca-certificates curl | |
| sudo install -m 0755 -d /etc/apt/keyrings | |
| sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
| sudo chmod a+r /etc/apt/keyrings/docker.asc | |
| # Add the repository to Apt sources: | |
| echo \ | |
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |