This file contains 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
let | |
nixpkgs = | |
import (builtins.fetchTarball { | |
url = https://github.com/NixOS/nixpkgs/archive/f5dad40450d272a1ea2413f4a67ac08760649e89.tar.gz; # Pinned to unstable. Update by picking a SHA from https://status.nixos.org | |
}) { }; | |
in | |
nixpkgs.mkShell { | |
buildInputs = [ | |
nixpkgs.ruby_3_1 | |
nixpkgs.nodejs-18_x |
This file contains 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
# This file has been generated by Niv. | |
let | |
# | |
# The fetchers. fetch_<type> fetches specs of type <type>. | |
# | |
fetch_file = pkgs: spec: | |
if spec.builtin or true then |
This file contains 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
let | |
nixpkgs = | |
import (builtins.fetchTarball { | |
url = https://github.com/NixOS/nixpkgs/archive/e6e6bad81b7e11f37d893ef39712ce8918ae2338.tar.gz; | |
}) { }; | |
in | |
nixpkgs.mkShell { | |
buildInputs = [ | |
nixpkgs.chromedriver | |
nixpkgs.ruby_3_1 |
This file contains 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
#!/usr/bin/env bash | |
# Datadog bills by the number of unique hosts that were used in the month and | |
# every time we launch a one off dyno it results in a new | |
# host (e.g. run.4030404). This script is executed when the dyno launches and | |
# determines whether the agent should be running to reduce the number of | |
# unique hosts that we are billed for. | |
# Disable the Datadog Agent for one-off runs (e.g. console, release). | |
if [ "$DYNOTYPE" == "run" ] || [ "$DYNOTYPE" == "release" ]; then |
This file contains 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
$ ruby 01_bingo.rb > ~/Downloads/board_1.html |
This file contains 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 MyView: UIView { | |
func set(borderTintColor: UIColor?, forControlState controlState: UIControl.State) { | |
// literally empty | |
} | |
// I've also tried prefixing with @objc | |
} |
This file contains 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 MyView: UIView { | |
func set(borderTintColor: UIColor?, forControlState controlState: UIControl.State) { | |
// literally empty | |
} | |
// I've also tried prefixing with @objc | |
} |
This file contains 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 UIKit | |
class LayoutMarginsHackView: UIView { | |
var actualLayoutMargins: UIEdgeInsets = .zero | |
override var layoutMargins: UIEdgeInsets { | |
set { | |
if #available(iOS 11, *) { | |
super.layoutMargins = newValue | |
} else { |
This file contains 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
# AttributeEncrypted is a simple way to encrypt values in the database | |
# using the same mechanism as Rails credentials, including the master key. | |
# | |
# Example: | |
# class User | |
# include AttributeEncrypted | |
# | |
# attr_accessor :encrypted_secret | |
# attr_encrypted :secret | |
# end |
This file contains 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
module Equality | |
def ==(other) | |
return false unless other.is_a?(self.class) | |
instance_variables.all? do |ivar| | |
instance_variable_get(ivar) == other.instance_variable_get(ivar) | |
end | |
end | |
end |
NewerOlder