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
// Your challenge is to find ways to simplify this code further. | |
// You can use any patterns or refactoring techniques you find useful. | |
// Think about improving readability and maintainability while ensuring the | |
// functionality remains intact. | |
// Backend response | |
{ | |
"operations": [ | |
{ |
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
class Team { | |
constructor(members) { | |
this._members = members; | |
} | |
get members() { | |
return this._members; | |
} | |
set members(members) { |
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
// Design Challenge 002: Simplifying State Management in React | |
// https://juntao.substack.com/p/design-challenge-002-simplifying | |
const ApprovalPanel = ({id}) => { | |
const [isDone, setDone] = useState(false); | |
const handleApprove = () => { | |
fetch('POST', `/rest/approval/${id}/approve`) | |
.then(r => r.json()) | |
.then(data => setDone(data.isDone)); |
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
const TemplateSelector = ({ templates }) => { | |
return ( | |
<div> | |
<SearchBar /> | |
<Category /> | |
<TemplateList templates={templates} /> | |
</div> | |
); | |
}; |
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
class Genre | |
MALE = 'man' | |
FEMALE = 'woman' | |
def self.count | |
2 | |
end | |
end | |
class Actor |
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
http://www.google.com | |
--------------------- | |
TITLE: Google | |
LANG: es | |
DESCRIPTION: Google.es permite acceder a la información mundial en castellano, catalán, gallego, euskara e inglés. | |
KEYWORDS: |
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 | |
# encoding: utf-8 | |
require 'io/console' | |
require 'debugger' | |
require 'pygments' | |
def winsize | |
$stdout.winsize | |
end |
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteRule ^$ web/ [L] | |
RewriteRule (.*) web/$1 [L] | |
</IfModule> |
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
cd /tmp | |
git clone git://git.kernel.org/pub/scm/git/git.git | |
cd git | |
git checkout v`git --version | awk '{print $3}'` | |
cp contrib/completion/git-completion.bash ~/.git-completion.bash | |
cd ~ | |
rm -rf /tmp/git | |
echo -e "source ~/.git-completion.bash" >> .profile |
NewerOlder