Skip to content

Instantly share code, notes, and snippets.

View prontiol's full-sized avatar
🤦‍♂️
undefined is not a function

Denys Mikhalenko prontiol

🤦‍♂️
undefined is not a function
View GitHub Profile
@prontiol
prontiol / pls splitter
Created March 25, 2015 16:11
Shell script for splitting pls playlist into single entry chunks
PLAYLIST=$1
echo "Using file: $PLAYLIST"
N=`grep 'NumberOfEntries' $PLAYLIST | sed 's/^.*=//g'`
echo "Total entries: $N"
for ((i=1; i<=$N; i++)) do
PLAYLIST1="playlist$i.pls"
echo '[playist]' > $PLAYLIST1
echo 'NumberOfEntries=1' >> $PLAYLIST1
@prontiol
prontiol / chrome.sh
Created May 4, 2015 21:10
Open Google Chrome with CORS disabled
open -a Google\ Chrome --args --disable-web-security
@prontiol
prontiol / z.sh
Created January 1, 2017 08:19
Zip all folders with encryption
for file in */ ; do
if [[ -d "$file" && ! -L "$file" ]]; then
target=${file%/}
zip -9 -er -P p4ssw0rd "$target.zip" "$target/";
fi
done
@prontiol
prontiol / macos.sh
Created January 1, 2017 12:11
macOS Sierra ISO
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg
hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/OS\ X\ Base\ System/
@prontiol
prontiol / apps.sh
Created January 3, 2017 14:29
Allow apps from anywhere on macOS Sierra
sudo spctl --master-disable
@prontiol
prontiol / fstab
Created January 3, 2017 14:43
SSH accepted access rights for mounted volume
LABEL=KEY none msdos -u=501,-m=700
@prontiol
prontiol / keybase.md
Created January 3, 2017 20:36
Keybase proof

Keybase proof

I hereby claim:

  • I am prontiol on github.
  • I am prontiol (https://keybase.io/prontiol) on keybase.
  • I have a public key whose fingerprint is F1A1 C826 2250 811C 5FF2 BFF5 7293 CECB 4512 49FF

To claim this, I am signing this object:

@prontiol
prontiol / MaskedInput.tsx
Created December 6, 2017 10:56
react-text-mask focus workaround
import TextMask from 'react-text-mask';
// here goes quick and dirty hack, to activate text-mask on focus
class CustomTextMask extends TextMask {
public render() {
const { mask, guide, pipe, placeholderChar, keepCharPositions, value, onChange, showMask, ...props } = this.props;
return (
<input
{...props}
@prontiol
prontiol / loading.css
Created December 6, 2017 12:34
datauri for generic ajax spinner
.loading {
background: url(data:image/gif;base64,R0lGODlhHgAeAPf2AP7+/v39/fDw8O/v7/z8/PHx8e7u7vv7++Xl5fr6+vn5+ebm5gAAAPX19fT09Pb29vPz8/f39/j4+Ofn5/Ly8tTU1O3t7dXV1cnJyezs7Ojo6Orq6uTk5OPj476+vuvr69nZ2cjIyNbW1unp6crKytjY2MvLy9zc3LOzs7KyssfHx+Hh4b+/v9/f3+Li4tPT097e3sDAwNfX193d3dra2sHBwYmJidvb2+Dg4L29vby8vM/Pz7e3t9LS0sTExNDQ0LS0tIiIiLW1tcbGxszMzLi4uLq6uoyMjHBwcMPDw8XFxVhYWLGxsXFxccLCws7Ozra2trCwsG9vb42Njbm5uc3NzXNzc4qKilpaWtHR0bu7u3JycpKSkjs7O3Z2dq+vr66urj09PVlZWaioqKSkpISEhIKCgpqaml5eXnR0dJGRkSIiIltbW2lpaaWlpYaGhouLi1NTUz4+PqmpqXh4eI6OjpWVlZCQkJSUlJ6enpiYmJycnKqqqmpqakNDQ4eHh6Kiop+fn6ysrCUlJW5ubklJSa2trVRUVIODg4WFhUBAQCAgIKGhoV9fX0FBQYGBgaamppaWlmxsbFxcXGBgYFdXV5OTk5mZmTY2NiQkJB8fH21tbXl5eVBQUDw8PHt7ez8/P11dXX9/fzU1NSgoKJubm2dnZzQ0NDMzM52dnVFRUWtra5eXlyoqKk5OTiMjI1VVVQoKCmRkZE1NTaurq0ZGRjk5OTc3N35+fo+Pj0VFRX19fSEhISkpKURERBsbGywsLCcnJ6enpxgYGB4eHmJiYlJSUhoaGk9PT3V1dWFhYR0dHUdHRwUFBQcHBzg4OICAgCsrK6CgoFZWVi4uLmNjY3x8fGhoaGZmZkJCQkhISBYWFmVlZTo6OkxMTBISEnp6eqOjoxUVFS0tLQsLCxwcHBcXFzIyMhkZGRERERMTEzExMQ8PDw4ODiYmJ
@prontiol
prontiol / reauthor.sh
Created September 15, 2018 06:08
Update name/email of past git commits
#!/bin/sh
git filter-branch -f --env-filter '
OLD_EMAIL="<old email>"
CORRECT_NAME="<new name>"
CORRECT_EMAIL="<new email>"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"