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 Array | |
def to_proc | |
proc {|x| inject(x) { |a, y| a.send(y) } } | |
end | |
end | |
class String | |
def to_proc | |
split(/\./).to_proc | |
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
.fluid-container, | |
.fluid-container *, | |
.fluid-container *:before, | |
.fluid-container *:after { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
.fluid-container { |
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 PrimalityChecker | |
module EratosthenesSieve | |
def self.prime?(n) | |
# Start at 7, because the obvious ones are crossed out | |
!(7..Math.sqrt(n)).any? {|p| n % p == 0 } | |
end | |
end | |
end | |
class PrimeCollector |
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
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Materialize/schemes/Material Brogrammer.tmTheme", | |
"file_exclude_patterns": | |
[ | |
"*.log" | |
], | |
"folder_exclude_patterns": | |
[ |
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
// <form id="form"> | |
// <input type="text" value="John Snow" name="first_name" /> | |
// <input type="file" name="image" /> | |
// </form> | |
// const formElement = document.getElementById("form") | |
// const formData = new FormData(formElement); | |
// const builder = new FormDataBuilder(); | |
// builder.append("values", formData); | |
// builder.data.get("values[first_name]"); == "John Snow" #=> "true" |
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
const LazyCollapse = ({ as: As = 'div', children, deps = [], ...props }) => { | |
const [show, setShow] = useState(false); | |
const [timestamp, setTimestamp] = useState(null); | |
const handleEnter = () => { | |
setShow(true); | |
}; | |
const handleExited = () => { | |
setShow(false); |