View slider-2-createThumbControl.js
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
function createThumbControl(thumbObject, thumb, minValue, maxValue, pixels, orientation) { | |
if (orientation !== 'horizontal' && orientation !== 'vertical') { | |
throw new Error('Orientation must be either \'horizontal\' or \'vertical\''); | |
} | |
if (isNaN(thumb.stepSize)) { | |
throw new Error('Step size must be a number.'); | |
} | |
if (isNaN(thumb.initialValue)) { |
View stripe-elements-lowercase-placeholder.js
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.card = this.elements.create("card", { style: { | |
base: { | |
"::placeholder": { | |
textTransform: "lowercase" | |
} | |
} | |
}}) |
View index.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
<!DOCTYPE html> | |
<body> | |
<style> | |
body { | |
font-family: sans-serif; | |
padding: 20px; | |
margin: 0; | |
} | |
</style> | |
<form> |
View init.diff
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
diff --git a/spec/compiler/crystal/tools/init_spec.cr b/spec/compiler/crystal/tools/init_spec.cr | |
index 7d59a6586..49199397c 100644 | |
--- a/spec/compiler/crystal/tools/init_spec.cr | |
+++ b/spec/compiler/crystal/tools/init_spec.cr | |
@@ -6,6 +6,7 @@ require "ini" | |
require "spec" | |
require "yaml" | |
require "../../../support/tempfile" | |
+require "../../../support/env" | |
View hacker-news-filter.js
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
// ==UserScript== | |
// @name De-Culture-War Hacker News | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Hides any Hacker News story with more comments than points. | |
// @author Nate Berkopec | |
// @include https://news.ycombinator.com/* | |
// @grant none | |
// ==/UserScript== |
View datetime_controller.js
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 { Controller } from "stimulus" | |
import strftime from "strftime" | |
import { capitalize } from "src/helpers" | |
const LOCALIZED_STRFTIME = { | |
en: strftime.localizeByIdentifier("en_US"), | |
fr: strftime.localizeByIdentifier("fr_FR"), | |
es: strftime.localizeByIdentifier("es_MX"), | |
it: strftime.localizeByIdentifier("it_IT"), | |
de: strftime.localizeByIdentifier("de_DE"), |
View textarea_controller.js
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 { Controller } from "stimulus" | |
export default class extends Controller { | |
handle(event) { | |
event.target.rows = event.target.value.split("\n").map((row) => { | |
return Math.ceil((row.length + 1) / event.target.cols) | |
}).reduce((acc, el) => acc + el) | |
} | |
} |
View belongs_to_optional_true_with_invalid_foreign_key.rb
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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem "rails", github: "rails/rails", branch: "main" |
View simple-types.rb
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
require "rspec" | |
class Class | |
def |(other) | |
Type.new(self, other) | |
end | |
def class_of?(object) | |
object.is_a?(self) | |
end |
View .rubocop.yml
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
AllCops: | |
NewCops: enable | |
Exclude: | |
- "react-native/**/*" | |
- "node_modules/**/*" | |
- "vendor/**/*" | |
- "db/schema.rb" | |
- "bin/*" | |
inherit_gem: |
OlderNewer