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
# frozen_string_literal: true | |
require 'rails_helper' | |
RSpec.describe Mutations::CreateOrganization, type: :graphql do | |
let(:query) do | |
<<~GQL | |
mutation($input: CreateOrganizationInput!) { | |
admin { | |
createOrganization(input: $input) { |
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
"diagnostic-languageserver.linters": { | |
"rubocop": { | |
"args": [ | |
"--format", | |
"quiet", | |
"--no-color", | |
"--force-exclusion", | |
"--stdin", | |
"%filename" | |
], |
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
{ | |
"calendar_months": [ | |
{ | |
"abbr_name": "Aug", | |
"day_names": [ | |
"Sun", | |
"Mon", | |
"Tue", | |
"Wed", | |
"Thu", |
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
nnoremap <silent> H :call <sid>tabline_control('tabN', 'bp')<cr> | |
nnoremap <silent> L :call <sid>tabline_control('tabn', 'bn')<cr> | |
function! s:tabline_control(tab_cmd, buf_cmd) abort | |
let a:tabnrs = [] | |
tabdo call extend(a:tabnrs, [tabpagenr()]) | |
exec len(a:tabnrs) > 1 ? a:tab_cmd : a:buf_cmd | |
endfunction |
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 Listing < ApplicationRecord | |
belongs_to :author, class_name: 'Person', inverse_of: :listings | |
end | |
class Person < ApplicationRecord | |
has_many :listings, foreign_key: 'author_id', inverse_of: :author | |
end | |
[4] pry(main)> Person.find('c-m9PWhIar54aabagq7ICb').listings.first.author; | |
Person Load (0.9ms) SELECT `people`.* FROM `people` WHERE `people`.`id` = '1' LIMIT 1 |
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 ApplicationRecord < ActiveRecord::Base | |
self.abstract_class = true | |
class << self | |
# implements would take a list of modules and verify that the model "implementing" | |
# defines the methods inside of the interface on itself | |
def implements(*interfaces) | |
interfaces_with_methods = interfaces.map do |interface| | |
[interface.name, interface.instance_methods(false)] | |
end |
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
```javascript | |
like | |
this | |
and stuff | |
``` |
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
#!/bin/sh | |
failure_status=0 | |
git_cmd() { | |
git diff --diff-filter=d --cached --name-only | grep -E $1 | |
} | |
if_fail() { | |
if [ $? -ne 0 ]; then |
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
const styles = { | |
submitButton: { | |
backgroundColor: '#33c567', | |
float: 'right', | |
fontWeight: 'bold', | |
margin: 0, | |
padding: [0, 30], | |
}, | |
}; |
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
server { | |
listen [::]:80; | |
listen 80; | |
server_name ~^(?<sub>[\w\-]+)\.domainhere\.com$; | |
rewrite ^/en/(.*)$ $1 last; | |
return 301 $scheme://domainhere.com/$sub$request_uri; | |
} |
NewerOlder