Skip to content

Instantly share code, notes, and snippets.

View Dimon70007's full-sized avatar
🏠
Working from home

Dmitry Dimon70007

🏠
Working from home
View GitHub Profile
@Dimon70007
Dimon70007 / git_push_alias
Last active June 7, 2023 12:05
alias for push current branch to origin remote git repo
For lazy people))) you can add this alias to your ~/.bash_profile or ~/.zprofile or ~/.bashrc
```bash
alias push_current='git push origin `git branch | grep "*" | sed "s/\* //"`'
```
then call `source ~/.bash_profile`
when you want to push current branch to remote git repo
just call
```
@Dimon70007
Dimon70007 / homebrew-permissions-issue.md
Last active April 13, 2023 12:32 — forked from irazasyed/homebrew-permissions-issue.md
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

in mac os ventura should just install ruby with homebrew instead of rbenv

@Dimon70007
Dimon70007 / clean_project.sh
Created January 31, 2023 11:59
Remove temporary files script recursivelly
#!/bin/bash
dirs_to_remove='Pods build builds node_modules*'
if [ -z "$target_dir" ]; then
target_dir='./'
fi
echo ">>> Will be removed dirs <<<"
del_dir () {
@Dimon70007
Dimon70007 / Makefile Tricks
Created August 18, 2021 10:40 — forked from pushandplay/Makefile Tricks
Makefile Tricks: Arithmetic – Addition, Subtraction, Multiplication, Division, Modulo, Comparison
NUMBER1 := 10
NUMBER2 := 5
#Addition
ADD := $(shell echo ${NUMBER1}+${NUMBER2} | bc)
#Subtraction
SUBTRACT := $(shell echo ${NUMBER1}-${NUMBER2} | bc)
#Multiplication
@Dimon70007
Dimon70007 / Podfile
Created December 6, 2019 16:39
cocoapods Debug hook for project with many schemes and configurations
# targets with dependencies
# This is an alternative for manually specifying every configuration as :debug [link](http://guides.cocoapods.org/syntax/podfile.html#project).
# Because of cocoapods by default uses :release type for all configurations but Debug
# we need to change every configuration, named <configuration_name>.Debug
# at the bottom of file
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
@Dimon70007
Dimon70007 / Podfile
Last active November 18, 2019 23:15
resolving static and dynamic frameworks or libraries with cocoapods
# Add this code at the top of Podfile
use_frameworks!
dynamic_frameworks = ['Alamofire', 'Async', 'Moya', 'Result', 'RxCocoa', 'RxSwift', 'SwiftyXMLParser', 'TrueTime']
# make all the other frameworks into static frameworks by overriding the static_framework? function to return true
pre_install do |installer|
installer.pod_targets.each do |pod|
if !dynamic_frameworks.include?(pod.name)
puts "Overriding the static_framework? method for #{pod.name}"
@Dimon70007
Dimon70007 / gist:238a7a0371183c6ed4bea8a97bef6437
Created July 2, 2019 20:02
sample build.gradle for library. that uses buildGradle version from root project
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
buildscript {
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
@Dimon70007
Dimon70007 / Adapter for Drawer
Created May 15, 2019 23:20
Adapter for Drawer (native-base uses react-native-drawer under the hood)
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Drawer } from 'native-base';
import { noop } from '../utils';
const drawerStyles = {
drawer: {
shadowColor: '#000000', shadowOpacity: 0.5, shadowRadius: 3, shadowOffset: { width: 1, height: 5 },
},
main: { paddingLeft: 3 },
@Dimon70007
Dimon70007 / gist:e91ad3006930e84936fe2605320e2b9a
Created April 23, 2019 09:24
copy ssh key to new system
cp /path/to/my/key/id_rsa ~/.ssh/id_rsa
cp /path/to/my/key/id_rsa.pub ~/.ssh/id_rsa.pub
# change permissions on file
sudo chmod 600 ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/id_rsa.pub
# start the ssh-agent in the background
eval $(ssh-agent -s)
# make ssh agent to actually use copied key
ssh-add ~/.ssh/id_rsa
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void flussonic.watcher.sdk.presentation.timeline.FlussonicTimelineView.collapse()' on a null object reference
at flussonic.watcher.sdk.presentation.watcher.FlussonicWatcherView.lambda$tryCollapseTimeline$2(FlussonicWatcherView.java:582)
at flussonic.watcher.sdk.presentation.watcher.-$$Lambda$FlussonicWatcherView$kfbfhYsS9XvYSUCapHnxGSyedeU.onAnimationEnd(lambda)
at flussonic.watcher.sdk.presentation.timeline.animation.AnimationListener.onAnimationEnd(AnimationListener.java:27)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1239)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:766)
at android.animation.ValueAnimator$AnimationHandler$1.run(ValueAnimator.java:801)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at androi