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
[ | |
{ | |
"BTTAppBundleIdentifier" : "com.jgraph.drawio.desktop", | |
"BTTAppName" : "draw.io", | |
"BTTAppAutoInvertIcon" : 1, | |
"BTTAppProcessMatchMode" : 2, | |
"BTTAppProcessName" : "draw.io", | |
"BTTTriggers" : [ | |
{ | |
"BTTLastUpdatedAt" : 1702656741.3490081, |
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
alias 'e'="earthly" | |
alias 'ealias'="alias | grep --color=never earthly" | |
alias 'ea'='earthly account' | |
alias 'eac'='earthly account create' | |
alias 'eah'='earthly account help' | |
alias 'eai'='earthly account invite' | |
alias 'ealp'='earthly account list-permissions' | |
alias 'eals'='earthly account ls' | |
alias 'ear'='earthly account revoke' |
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
<template> | |
<FormulateSlot | |
name="grouping" | |
:class="context.classes.grouping" | |
:context="context"> | |
<FormulateRepeatableProvider | |
:index="0" | |
:set-field-value="(field, value) => setFieldValue(field, value)" | |
:context="context" |
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
# MIT License, Copyright (c) 2019 Brian Bugh | |
# Do a UNION on two or more scopes, combining the results. Unlike Rails arel | |
# unions/`or`, this will preserve the ActiveRecord_Relation and allows for | |
# `joins` and `references`. It can also be chained with a scope without issue. | |
# | |
# NOTE: the scope `select` for each union must match; you can't select a smaller | |
# column subset and UNION it (this is a limitation of SQL). | |
# | |
# ==== Examples |
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
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts, | |
that detects and handles AJAXed content. Forked for use without JQuery. | |
Usage example: | |
waitForKeyElements ( | |
"div.comments" | |
, commentCallbackFunction | |
); | |
//--- Page-specific function to do what we want when the node is found. | |
function commentCallbackFunction (element) { | |
element.text ("This comment changed by waitForKeyElements()."); |
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
# taken from this answer on stack exchange: https://superuser.com/a/1180084 | |
# This will show the number of files open by all of the processes | |
sudo lsof -n | cut -f1 -d' ' | uniq -c | sort | tail | |
# When you find out which one is using the most files, see what files are being used by it | |
sudo lsof -n | grep java | |
# In my case, it's always java because elasticsearch doesn't clean up after being on for weeks, I guess | |
brew services restart elasticsearch |
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
// use with <i class="svg-icon bank-icon"></i> | |
.svg-icon { | |
vertical-align: middle; // you may not need this line depending on your icons | |
} | |
// borrowed from icomoon's font output | |
.svg-icon::before { | |
font-weight: normal; | |
font-style: normal; | |
font-variant: normal; |
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
import { ApolloClient } from 'apollo-client' | |
import { split } from 'apollo-link' | |
import { HttpLink } from 'apollo-link-http' | |
import { InMemoryCache } from 'apollo-cache-inmemory' | |
import { getMainDefinition } from 'apollo-utilities' | |
import { createPersistedQueryLink } from 'apollo-link-persisted-queries' | |
import { setContext } from 'apollo-link-context' | |
// AC: IMPORT ACTIONCABLE | |
import ActionCable from 'actioncable' |
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
Warming up -------------------------------------- | |
subtract 233.432k i/100ms # higher is better | |
bitwise & == 164.352k i/100ms | |
bitwise & size 218.548k i/100ms | |
bitwise & [] 200.794k i/100ms | |
contains_all 74.648k i/100ms | |
contains_all_count 112.634k i/100ms | |
set 19.238k i/100ms | |
set cached 194.675k i/100ms | |
all? include? 144.048k i/100ms |
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
# app/models/validators/array_inclusion_validator.rb | |
class ArrayInclusionValidator < ActiveModel::EachValidator | |
include ActiveModel::Validations::Clusivity | |
def validate_each(record, attribute, values) | |
values.each do |value| | |
unless include?(record, value) | |
message = (options[:message].try(:gsub, '%{value}', value) || "#{value} is not included in the list") | |
record.errors.add(attribute, :array_inclusion, message: message, value: value) | |
end |
NewerOlder