This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Unique, atomic sequential number generator using MongoMapper, MongoDB and Ruby. | |
| # Usage: | |
| # Helper::Sequence.next_value(:my_seq) | |
| # => 1 | |
| # Helper::Sequence.next_value(:my_seq) | |
| # => 2 | |
| # Helper::Sequence.next_value(:my_other_seq) | |
| # => 1 | |
| # Helper::Sequence.next_value(:my_seq) | |
| # => 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM phusion/baseimage:0.9.22 | |
| CMD ["/sbin/my_init"] | |
| RUN add-apt-repository -y ppa:brightbox/ruby-ng | |
| RUN apt-get update | |
| RUN apt-get install -y libpq-dev git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs wget autoconf tzdata ruby2.4 ruby2.4-dev rubygems ruby-switch | |
| RUN ruby-switch --set ruby2.4 | |
| RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Read the docs: https://www.lunarvim.org/docs/configuration | |
| -- Example configs: https://github.com/LunarVim/starter.lvim | |
| -- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6 | |
| -- Forum: https://www.reddit.com/r/lunarvim/ | |
| -- Discord: https://discord.com/invite/Xb9B4Ny | |
| -- | |
| -- Additional NeoVim plugins: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source :rubygems | |
| # We are not loading Active Record, nor Active Resources etc. | |
| # We can do this in any app by simply replacing the rails gem | |
| # by the parts we want to use. | |
| gem "actionpack", "~> 4.0" | |
| gem "railties", "~> 4.0" | |
| gem "tzinfo" | |
| # Let's use thin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule UI.Application do | |
| use Application | |
| def start(_type, _args) do | |
| # List of children to be started when checks succeed | |
| delayed_children = [ | |
| UI.Endpoint, | |
| {Absinthe.Subscription, UI.Endpoint} | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| query = "query { | |
| project(id: 1389) { | |
| id, | |
| slices { | |
| id, | |
| todos { | |
| id, | |
| title, | |
| description, | |
| progress, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HelloWorldController < AbstractController::Base | |
| include AbstractController::Rendering | |
| include AbstractController::Layouts | |
| include AbstractController::Helpers | |
| include AbstractController::Translation | |
| include AbstractController::AssetPaths | |
| include ActionController::UrlWriter | |
| # Uncomment if you want to use helpers defined in ApplicationHelper in your views | |
| # helper ApplicationHelper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| For 2 people will need: | |
| 1. Spices | |
| - 1 table spoon of red curry paste | |
| - 2 anise stars | |
| - 3 cardamom seeds | |
| - 3 cloves | |
| - 1 piece of cinnamon bark | |
| - 1 long pepper | |
| - 2 table spoons of garam masala |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| irb(main):029:0> Benchmark.bm do |x| | |
| irb(main):030:1* x.report("Strings: ") { 10000000.times {"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".hash} } | |
| irb(main):031:1> x.report("Symbols: ") { 10000000.times {:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.hash} } | |
| irb(main):032:1> end | |
| user system total real | |
| Strings: 1.290000 0.000000 1.290000 ( 1.282911) | |
| Symbols: 0.450000 0.000000 0.450000 ( 0.458915) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 09:46:57.136 [error] #PID<0.600.0> running Todos.UI.Endpoint terminated | |
| Server: localhost:4001 (http) | |
| Request: POST /login | |
| ** (exit) an exception was raised: | |
| ** (DBConnection.ConnectionError) connection not available because of disconnection | |
| (db_connection) lib/db_connection.ex:926: DBConnection.checkout/2 | |
| (db_connection) lib/db_connection.ex:742: DBConnection.run/3 | |
| (db_connection) lib/db_connection.ex:584: DBConnection.prepare_execute/4 | |
| (ecto) lib/ecto/adapters/postgres/connection.ex:73: Ecto.Adapters.Postgres.Connection.prepare_execute/5 | |
| (ecto) lib/ecto/adapters/sql.ex:256: Ecto.Adapters.SQL.sql_call/6 |
NewerOlder