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
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| RSpec::Matchers.define(:be_same_file_as) do |exected_file_path| | |
| match do |actual_file_path| | |
| md5_hash(actual_file_path).should == md5_hash(exected_file_path) | |
| end | |
| def md5_hash(file_path) | |
| Digest::MD5.hexdigest(File.read(file_path)) | |
| end | |
| 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
| <html lang=”en”> | |
| <head> | |
| <link rel=”preload” href=”./vendor.js” as=”script”> | |
| <link rel=”preload” href=”./app.js” as=”script”> | |
| <body> | |
| <main id=”root” style=”height: 100%”></main> | |
| <script type=”text/javascript”> | |
| scripts = [‘./vendor.js’,’./app.js’]; | |
| if (!(“fetch” in window && “Promise”)) { | |
| scripts.unshift(‘./polyfills.js’); |
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
| {"lastUpload":"2018-04-18T21:37:05.918Z","extensionVersion":"v2.9.0"} |
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
| function useFormInput() { | |
| const [value, setValue] = useState(); | |
| const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => { | |
| setValue(e.target.value); | |
| }; | |
| return { | |
| value, | |
| onChange: handleChange, | |
| }; |
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
| <Form.Input | |
| fluid={true} | |
| icon="calendar" | |
| iconPosition="left" | |
| placeholder="Your birthday" | |
| type="date" | |
| {...birthday} | |
| /> |
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
| function App() { | |
| const birthday = useFormInput(); | |
| return ( | |
| <div className="App"> | |
| <Grid textAlign="center" style={{ height: '100%' }} verticalAlign="middle"> | |
| <Grid.Column style={{ maxWidth: 450 }}> | |
| <Form size="large"> | |
| <Segment stacked={true}> | |
| <Form.Input | |
| fluid={true} |
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
| @decorator | |
| def func_name(): | |
| pass |
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
| def authed(func): | |
| def auth_check(*args, **kwargs): | |
| print("checking authentication") | |
| func(*args, **kwargs) | |
| print("post-process") | |
| return auth_check |
OlderNewer