'(\d.)px'
$1
repos=( | |
"user/repo" | |
"user/repo1" | |
"user/repo2" | |
) | |
for i in "${repos[@]}" | |
do | |
: | |
curl -XDELETE -H 'Authorization: token yourtokenhere' "https://api.github.com/repos/$i "; |
curl "https://api.github.com/users/username/repos?per_page=100" | grep -o 'git@[^"]*' | sed "s/.git//g" | sed "s/github.com://g" |
grep -rnw './' -e '//TODO:' |
ignore() { | |
echo "\n$1" >>.gitignore | |
echo "added $1 to .gitignore" | |
} | |
# use | |
# ignore .DS_STORE |
alias branch='git symbolic-ref --short HEAD' | |
alias upstream='git push --set-upstream origin $(echo $(branch))' | |
# use | |
# cd some_project | |
# upstream |
import { useEffect } from 'react'; | |
export const useDisableBodyScroll = (open) => { | |
useEffect(() => { | |
if (open) { | |
document.body.style.overflow = 'hidden'; | |
} else { | |
document.body.style.overflow = 'unset'; | |
} | |
}, [open]); |
#!/bin/bash | |
lowercase_remove_dash () { | |
sed -e 's/-//g' $1 | tr '[:upper:]' '[:lower:]' | |
} | |
find . -maxdepth 1 -regex '\./.*\.fsa' | while read file; do printf "%s\n" $(lowercase_remove_dash $file) > $file; done |
https://github.com/callstack/haul/issues/463#issuecomment-408922287 |
from django.conf import settings | |
XS_SHARING_ALLOWED_ORIGINS = getattr(settings, "XS_SHARING_ALLOWED_ORIGINS", '') | |
XS_SHARING_ALLOWED_METHODS = getattr(settings, "XS_SHARING_ALLOWED_METHODS", | |
['POST', 'GET', 'OPTIONS', 'PUT']) | |
def xssharing_middleware(get_response): | |
def middleware(request): | |
response = get_response(request) | |
if response.has_header('Access-Control-Allow-Origin'): |