Skip to content

Instantly share code, notes, and snippets.

View onmotion's full-sized avatar
:octocat:

Alexandr Kozhevnikov onmotion

:octocat:
View GitHub Profile
@onmotion
onmotion / bash.sh
Created January 30, 2024 12:41
Android emulator React Native port forwarding (to debug disabled network with Metro)
adb root
adb reverse tcp:8081 tcp:8081
adb shell setprop metro.host "localhost"
@onmotion
onmotion / CssTextField.js
Last active June 7, 2022 12:14
MUI TS styled component add props
export const CssTextField = styled(TextField, {
shouldForwardProp: (prop) => prop !== "resize",
})<{ resize?: boolean }>(({ theme, resize }) => {
console.log({ resize });
return {
root: {
"& label.Mui-focused": {
color: theme.palette.primary.light,
},
@onmotion
onmotion / install-git-completion.sh
Last active June 27, 2019 10:10 — forked from johngibb/install-git-completion.sh
Mac OS X - Install Git Completion
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash"
PROFILE="$HOME/.profile"
echo "Downloading git-completion..."
if ! curl "$URL" -Ls -o "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
fi
@onmotion
onmotion / slot-passing.vue
Last active May 27, 2019 11:48
Vue js pass slot to child component wrapper through template
<!-- pass scoped slots -->
<!-- bind props as a Object for reactively binding props which contains getter and setter -->
<template v-for="(_, name) in $scopedSlots" v-slot:[name]="slotData">
<slot :name="name" v-bind="{props: slotData}" />
</template>
<!-- pass slots -->
<template v-for="(_, name) in $slots" :slot="name">
<slot :name="name"/>
</template>
@onmotion
onmotion / acme-wildcard-snippet.sh
Created April 8, 2019 07:05
acme wildcard issue snippet
#!/bin/bash
acme.sh --issue -d domain.ru -d '*.domain.ru' --dns dns_cloudns --staging --debug 2
@onmotion
onmotion / gist:258760396b4ec902eefe7f255bf7091c
Created October 11, 2018 07:34
webhook secret for packagist
{"repository":{"url":"https://packagist.org/packages/YOUR PACKAGE URL"}}
@onmotion
onmotion / remove all directories except.sh
Created August 14, 2018 10:36
remove all directories except
#!/bin/bash
find . ! -name 'thumbnails' -type d -maxdepth 1 -exec rm -rf {} +
@onmotion
onmotion / git remove all branches except master.sh
Created June 6, 2018 12:01
git remove all branches except master
#!/bin/bash
# local
git branch | grep -v "master" | xargs git branch -D
# remote
git branch -a --merged remotes/origin/master | grep -v master | grep "remotes/origin/" | cut -d "/" -f 3- | xargs -n 1 git push --delete origin
@onmotion
onmotion / dd-wrt tcpdump
Created March 24, 2018 16:15
dd-wrt tcpdump
For anyone having this problem, try this to install it in RAM:
/bin/ipkg -d /tmp/root -force-depends install tcpdump
It still won't work from command prompt as usual, but you can run it like this if you have libpcap installed in jffs still:
mount --bind /tmp/smbshare /jffs
nvram set sys_enable_jffs2=1
ipkg update failed for me, so I did a work-around:
mkdir -p /jffs/tmp/ipkg
ipkg update
ipkg list