A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord
#!/bin/bash | |
# This script will install AMDGPU-PRO OpenCL and Vulkan support. | |
# | |
# For Ubuntu and it's flavor, just install the package using this command | |
# in extracted driver directory instread. | |
# | |
# ./amdgpu-pro-install --opencl=legacy,pal --headless --no-dkms | |
# | |
# For Arch Linux or Manjaro, use the opencl-amd or rocm-opencl-runtime on AUR instread. |
require "dry/monads/result" | |
class ApplicationForm | |
include Dry::Monads::Result::Mixin | |
include ActiveModel::Model | |
def self.attribute(name, options = {}) | |
self.send(:attr_accessor, name) | |
_attributes << Attribute.new(name, options) | |
end |
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
const strategy = 'keycloak' | |
export default function ({ app }) { | |
const { $axios, $auth } = app | |
if (!$auth.loggedIn || !$auth.strategies[strategy]) | |
return | |
const options = $auth.strategies.keycloak.options |
class ApplicationController | |
before_action :authenticate_user | |
def authenticate_user | |
response = TokenAuthService.call(token: request.headers['Api-Token'] || params[:api_token]) | |
if response.failure? | |
render json: { | |
error: 'Not Authorized', | |
message: response.error |
This HoC gives you a way to work with co-located fragments that is similar to Relay's FragmentContainer
It supports both fragment maps extrapolation of prop names from fragment definitions.
Fragment map
export default withFragments({
price: gql`
fragment ProductDetails_price on Product {
From 03b014746fa67bb76d73d9ff5274dce461fa413b Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> | |
Date: Sat, 19 Aug 2017 14:34:00 +0200 | |
Subject: [PATCH 1/2] Adjust to tray removal in gnome-shell | |
GNOME 3.26 will no longer display status icons by default, so there is | |
no system tray we can take over. Take this case into account to avoid | |
errors, although this alone doesn't give us back status icons - we will | |
do that in a second step by starting to manage our own tray. | |
--- |
# frozen_string_literal: true | |
class AssociationLoader < GraphQL::Batch::Loader | |
attr_reader :klass, :association | |
def initialize(klass, association) | |
raise ArgumentError, "association to load must be a symbol (got #{association.inspect})" unless association.is_a?(Symbol) | |
raise ArgumentError, "cannot load associations for class #{klass.name}" unless klass < ActiveRecord::Base | |
raise TypeError, "association #{association} does not exist on #{klass.name}" unless klass.reflect_on_association(association) | |
@klass = klass |