Skip to content

Instantly share code, notes, and snippets.

View gotev's full-sized avatar

Aleksandar 'Alex' Gotev gotev

View GitHub Profile
@gotev
gotev / remove-alpha-channel.sh
Created June 28, 2018 16:36
Remove alpha channel from PNGs in a directory
for file in $(ls *.png); do convert "$file" -alpha remove -alpha off "$file"; done
@gotev
gotev / .bash_profile
Created November 11, 2017 10:56
Colorful macOS terminal
# Colorful terminal
export PATH=/usr/local/bin:$PATH
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
@gotev
gotev / remove-submodule.sh
Last active May 10, 2019 05:03
Remove git submodule
#!/bin/bash
NAME="$1"
if [ "x$NAME" == "x" ]; then
echo "please tell me the submodule name to remove"
exit -1
fi
TMP_NAME="${NAME}_tmp"
@gotev
gotev / RemoteHostChecks.md
Last active September 10, 2017 00:19
Remote host checks cheatsheet from linux

Check host reachability

IPv4

ping hostname_or_ip

IPv6

ping6 hostname_or_ip
@gotev
gotev / AutoIncrementPodSpec.md
Created July 10, 2017 08:13
Auto increment podspec build

The problem

Auto increment podspec version. I have a MyPodName.podspec file like this:

Pod::Spec.new do |s|
  s.name         = "MyPodName"
  s.version      = "1.0.32"
  s.summary       = "My pod summary"
 s.description = <<-DESC
@gotev
gotev / listServerSideCipherSuites.md
Last active January 6, 2022 05:45
List server-side cipher suites

On OS X:

brew install nmap
nmap --script ssl-enum-ciphers -p 443 example.server.com

Example output

Starting Nmap 7.40 ( https://nmap.org ) at 2017-05-18 15:34 CEST
Nmap scan report for example.server.com (1.2.3.4)
Host is up (0.036s latency).
@gotev
gotev / preBuildGradleTask.groovy
Created December 21, 2016 18:24
Pre build gradle task
// add this after dependencies section in a module
// this script has to be in the same path as the module
// otherwise, relative or absolute paths has to be used
task someScript(type: Exec) {
commandLine 'sh', '-c', './some_script.sh'
}
preBuild.dependsOn someScript
@gotev
gotev / ProximitySensor.java
Last active February 26, 2019 10:44
Android Proximity Sensor helper
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Build;
import android.os.PowerManager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
@gotev
gotev / ThrottledSearch.java
Last active February 6, 2021 08:47
Android Throttled Search
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import java.util.Timer;
import java.util.TimerTask;
/**
@gotev
gotev / UIColorFromRGB.swift
Last active December 5, 2017 12:23
Color from Hex String in Swift 3
//
// UIColorFromRGB.swift
//
//
// Created by Alex Gotev on 21/11/16.
//
//
import Foundation
import UIKit