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
| export default { | |
| meta: { | |
| type: 'problem', | |
| docs: { | |
| description: 'Disallow multiple consecutive spaces in string literals', | |
| category: 'Possible Errors', | |
| recommended: true, | |
| }, | |
| fixable: 'code', | |
| schema: [], |
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
| mkdir -p frames | |
| # Generate 120 solid-color frames (30 seconds @ 4 fps = 0.25s per frame) | |
| for i in {1..120}; do | |
| COLOR=$(openssl rand -hex 3) | |
| FRAME_NUM=$(printf %03d $i) | |
| magick -size 640x480 xc:"#${COLOR}" \ | |
| -gravity center \ | |
| -fill white \ | |
| -pointsize 72 \ |
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
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "PublicReadGetObject", | |
| "Effect": "Allow", | |
| "Principal": "*", | |
| "Action": "s3:GetObject", | |
| "Resource": "arn:aws:s3:::bucket-name/*" | |
| } |
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 isIsogram(str){ | |
| const usedChars = [] | |
| for(let i = 0; i < str.length; i+=1) { | |
| if(!usedChars.includes(str[i].toLowerCase())){ | |
| usedChars.push(str[i].toLowerCase()) | |
| } | |
| } | |
| return usedChars.length === str.length | |
| } |
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
| /* | |
| Post With Explanation: https://www.linkedin.com/posts/umairjibran_javassript-activity-7031246560059379712-hPp4 | |
| */ | |
| const flattenArray = array => { | |
| return array.reduce((acc, val) => { | |
| return Array.isArray(val) | |
| ? acc.concat(flattenArray(val)) | |
| : acc.concat(val); | |
| }, []); |
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
| git checkout -b new-branch # new-branch or branch name where you actually wanted to make commit | |
| git checkout master # master or any branch where you have accidentally made commit | |
| git reset --hard HEAD~1 # replace 1 with number of commits you want to go back | |
| git push --force # forces the remote to accept the <local> HEAD as new <remote> HEAD |
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 isValidEmail = (email) => { | |
| return String(email) | |
| .toLowerCase() | |
| .match( | |
| /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ | |
| ); | |
| }; |
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
| [ | |
| { | |
| "AllowedHeaders": [ | |
| "*" | |
| ], | |
| "AllowedMethods": [ | |
| "GET", | |
| "POST", | |
| "PUT" | |
| ], |
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
| 2xx Success | |
| 200 OK | |
| 201 Created | |
| 3xx These are not errors, just something that does not meet the business logic | |
| 300 Multiple Choices | |
| 4xx Client side errors | |
| 400 Bad Request | |
| 401 Not Authorised |
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
| 1×× Informational | |
| 100 Continue | |
| 101 Switching Protocols | |
| 102 Processing | |
| 2×× Success | |
| 200 OK | |
| 201 Created |
NewerOlder