Skip to content

Instantly share code, notes, and snippets.

View teologov's full-sized avatar

Andrey Teologov teologov

View GitHub Profile
@teologov
teologov / conda.sh
Last active September 10, 2020 12:51
Conda commands
# create a new conda environment in ./cenv, aliased to ccreate
conda create --prefix ./cenv python
# remove the environment
conda env remove -p <full path to environment>
# activate the environment, aliased to cact
conda activate ./cenv
# install package, best to do from within the environment and allow defaults which is to install from conda repos
@teologov
teologov / symbolizing_osx_crash_logs.md
Created August 9, 2019 10:39 — forked from bmatcuk/symbolizing_osx_crash_logs.md
How to symbolize OSX crash logs

How to Symbolize OSX Crash Logs

Unfortunately, xcode does not yet have support for importing OSX crash logs and symbolizing them. Therefore, you must use the command line and a little bit of manual work.

  1. Find your dSYM file.
    1. Assuming you are using xcode's archive functionality, open the Organizer window from the Window menu.
    2. Click the Archives tab.
    3. Right click on the appropriate build and select Show in Finder.
    4. When Finder opens, right click on the selected archive and select Show Package Contents.
    5. Navigate to the dSYM directory and copy the appropriate dSYM file to a temporary directory.
  2. Then navigate to Products, then Applications, and copy the app file to the same temporary directory.
@teologov
teologov / Realm+CascadeDeleting.swift
Created April 14, 2019 10:17 — forked from krodak/Realm+CascadeDeleting.swift
Cascade deletion for RealmSwift
import RealmSwift
import Realm
protocol CascadeDeleting: class {
func delete<Entity>(_ list: List<Entity>, cascading: Bool)
func delete<Entity>(_ results: Results<Entity>, cascading: Bool)
func delete<Entity: Object>(_ entity: Entity, cascading: Bool)
}
# Defines all Languages known to GitHub.
#
# type - Either data, programming, markup, prose, or nil
# aliases - An Array of additional aliases (implicitly
# includes name.downcase)
# ace_mode - A String name of the Ace Mode used for highlighting whenever
# a file is edited. This must match one of the filenames in http://git.io/3XO_Cg.
# Use "text" if a mode does not exist.
# wrap - Boolean wrap to enable line wrapping (default: false)
# extensions - An Array of associated extensions (the first one is

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@teologov
teologov / readme.md
Created February 6, 2018 14:46 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@teologov
teologov / install virtualenv ubuntu 16.04.md
Created January 20, 2018 08:06 — forked from Geoyi/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@teologov
teologov / original_colors.lua
Created January 16, 2018 23:29 — forked from htoyryla/original_colors.lua
Use original colors in an image generated by fast-neural-style
-- this program takes an original image, such as a photo,
-- and a generated image, such as generated by jcjohnson/fast-neural-style
-- and copies the original colors to the generated image
-- like when using the original_colors param in jcjohnson/neural-style
--
-- by hannu töyrylä @htoyryla 30 oct 2016
--
require 'torch'
require 'image'
@teologov
teologov / gist:80db65e93ecdb2af4ff64dd88fa6667a
Created December 28, 2017 15:48 — forked from n00neimp0rtant/gist:9515611
simple squash without rebase
## within current branch, squashes all commits that are ahead of master down into one
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case)
## commit any working changes on branch "mybranchname", then...
git checkout master
git checkout -b mybranchname_temp
git merge --squash mybranchname
git commit -am "Message describing all squashed commits"
git branch -m mybranchname mybranchname_unsquashed
git branch -m mybranchname
public extension Int {
public var seconds: DispatchTimeInterval {
return DispatchTimeInterval.seconds(self)
}
public var second: DispatchTimeInterval {
return seconds
}