Skip to content

Instantly share code, notes, and snippets.

# works perfectly on BigSur
# get disk identifier from diskutil, something like:
# /dev/disk5 (external, physical):
# #: TYPE NAME SIZE IDENTIFIER
# 0: FDisk_partition_scheme *200.0 GB disk5
# 1: Windows_NTFS ⁨⁩ 12.6 GB disk5s1
# 2: Windows_NTFS ⁨⁩ 187.5 GB disk5s5
diskutil list
# create a folder where you want to mount your partition
sudo mkdir /Users/{your user}/Desktop/MyNTFS
@mdutkin
mdutkin / SVG.js
Last active July 24, 2019 07:10 — forked from beausmith/SVG.js
React Native SVG Component using react-native-svg
// React Native SVG Component
// https://github.com/react-native-community/react-native-svg
//
// Process
// 1. Clean up SVG in graphics app (Illustrator/Sketch/etc) to set consistent width, height, and make sure the viewBox is "0, 0, W, H"
// 2. Open SVG in text editor to remove width, height, and any undesired/unnecessary styles
// 3. Open in https://jakearchibald.github.io/svgomg/ and optimize.
// 4. Integrate info app by converting SVG tags to component-based SVG tags used in https://github.com/react-native-community/react-native-svg and updating with JS variables such that I can controls dimensions, colors, etc.
// You can use live converter here: https://www.smooth-code.com/open-source/svgr/playground/
// 5. Use in other components.
@mdutkin
mdutkin / script.groovy
Last active October 11, 2019 22:32
Jenkins delete old build for job via Script Console
import jenkins.model.Jenkins
import hudson.model.Job
MAX_BUILDS = 5
Jenkins.instance.getAllItems(Job.class).each { job ->
if (job.fullName == 'DatabaseDocker/master') {
println job.fullName
def recent = job.builds.limit(MAX_BUILDS)
for (build in job.builds) {
if (!recent.contains(build)) {
@mdutkin
mdutkin / brew_install_docker.sh
Created June 7, 2018 06:59
install docker with virtualbox driver
# assume you've already installed brew
brew install docker docker-machine
docker-machine create -d virtualbox default
docker-machine start default && eval $(docker-machine env default) && docker ps -a
@mdutkin
mdutkin / finder_activator.workflow
Created May 29, 2018 19:31
apple script to switch to Finder window and open new one
on run {input, parameters}
tell application "Finder"
activate
make new Finder window to home
end tell
return input
end run
| is used to set a certain bit to 1
& is used to test or clear a certain bit
Set a bit (where n is the bit number, and 0 is the least significant bit):
unsigned char a |= (1 << n);
Clear a bit:
@mdutkin
mdutkin / rebuild_cython.sh
Created January 18, 2018 09:59
rebuild cython for PyCharm on Mac OS
python3.6 /Applications/PyCharm.app/Contents/helpers/pydev/setup_cython.py build_ext --inplace
@mdutkin
mdutkin / php71-pecl-mamche.txt
Last active October 11, 2017 21:18
install php7 memcache module for MAMP
download last from `https://github.com/websupport-sk/pecl-memcache/tree/NON_BLOCKING_IO_php7`
unzip && cd
/Applications/MAMP/bin/php/php7.1.8/bin/phpize
./configure --with-php-config=/Applications/MAMP/bin/php/php7.1.8/bin/php-config
and the output should be like:
...blablabla...
Libraries have been installed in:
@mdutkin
mdutkin / react-native-mapview AnimatedImplementation.js hack for RN0.25
Created April 28, 2016 01:18
after upgrading to react-native 0.24.1 it's broken again. in this version some new stuff was added by FB, so we can't just replace an AnimatedImplementation.js as it's suggested in README. so, this new version of AnimatedImplementation.js fixes the issue
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule AnimatedImplementation
* @flow