In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literalIn programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal| import { useMemo } from 'react'; | |
| import { | |
| ApolloClient, | |
| HttpLink, | |
| ApolloLink, | |
| InMemoryCache, | |
| NormalizedCacheObject, | |
| concat, | |
| } from '@apollo/client'; | |
| import { createPersistedQueryLink } from '@apollo/client/link/persisted-queries'; |
| local lspconfig = require('lspconfig') | |
| -- https://github.com/tailwindlabs/tailwindcss-intellisense/issues/737 | |
| lspconfig.tailwindcss.setup { | |
| --on_attach = on_attach, | |
| --flags = lsp_flags, | |
| filetypes = { "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "haml", "handlebars", "hbs", "html", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "ruby" }, | |
| init_options = { | |
| userLanguages = { |
| # Basic key operators to query the JSON objects : | |
| # #> : Get the JSON object at that path (if you need to do something fancy) | |
| # -> : Get the JSON object at that path (if you don't) | |
| # ->> : Get the JSON object at that path as text | |
| # {obj, n} : Get the nth item in that object | |
| # https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE | |
| # Date | |
| # date before today |
| # official docs: https://graphql-ruby.org/dataloader/sources.html | |
| # app/graphql/sources/association.rb | |
| class Sources::Association < ::GraphQL::Dataloader::Source | |
| def initialize(association_name, scope = nil) | |
| @association_name = association_name | |
| @scope = scope | |
| end | |
| def fetch(records) |
| -- Eviline config for lualine | |
| -- Author: shadmansaleh | |
| -- Credit: glepnir | |
| local lualine = require 'lualine' | |
| -- Color table for highlights | |
| local colors = { | |
| bg = '#202328', | |
| fg = '#bbc2cf', | |
| yellow = '#ECBE7B', |
This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.
I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)
Before trying it out DIY, I considered using:
| $ git clone [email protected]:xxxxx/xxxx.git my-awesome-proj | |
| Cloning into 'my-awesome-proj'... | |
| ssh: connect to host github.com port 22: Connection timed out | |
| fatal: Could not read from remote repository. | |
| $ # This should also timeout | |
| $ ssh -T [email protected] | |
| ssh: connect to host github.com port 22: Connection timed out | |
| $ # but this might work |
Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.
You can get all of this information on the command line.
rails generate with no generator name will output a list of all available generators and some information about global options.
rails generate GENERATOR --help will list the options that can be passed to the specified generator.