-
condition check 와 action 양쪽 모두 코드로 되어 있으면 읽기 어렵다.
-
이를 method로 추출한다.
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
| #!/usr/bin/env ruby | |
| def run_and_echo(cmd) | |
| puts cmd | |
| result = system(cmd) | |
| raise "FAIL - `#{cmd}`" unless result | |
| end | |
| max_steps = ARGV[0].to_i | |
| begin |
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
| /*! debug.css | MIT License | zaydek.github.com/debug.css */ | |
| *:not(path):not(g) { | |
| color: hsla(210, 100%, 100%, 0.9) !important; | |
| background: hsla(210, 100%, 50%, 0.5) !important; | |
| outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; | |
| box-shadow: none !important; | |
| } |
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:( | |
| function() { | |
| ids = ['2058928', '17093928', '8577077', '20619567', '38043493']; | |
| form = document.querySelector('form[action*=review-requests]'); | |
| ids.forEach(function(id){ var input = document.createElement('input'); | |
| input.setAttribute('name', 'reviewer_user_ids[]'); | |
| input.setAttribute('value', id); | |
| form.appendChild(input); | |
| }); | |
| event = document.createEvent("HTMLEvents"); |
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
| # accounts/forms.py | |
| from django import forms | |
| from django.contrib.auth.forms import UserCreationForm, get_user_model | |
| class SignupForm(UserCreationForm): | |
| class Meta(UserCreationForm.Meta): | |
| fields = UserCreationForm.Meta.fields + ('email',) | |
| widgets = { | |
| 'username': forms.EmailInput(attrs={ |
Incorporates changes by 0mnius.
The intent is to define terse, standards-supported names for AWS regions.
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
| # ~/.config/fish/functions/rvm.fish | |
| function rvm --description "Ruby Version Manager" | |
| exec bash --login -c "rvm $argv; exec fish" ^&1 | |
| end |
NewerOlder