Skip to content

Instantly share code, notes, and snippets.

@akovardin
akovardin / HOWTODMG.md
Created March 19, 2021 12:13 — forked from jadeatucker/HOWTODMG.md
How to create a "DMG Installer" for Mac OS X

Creating a "DMG installer" for OS X

A DMG Installer is convenient way to provide end-users a simple way to install an application bundle. They are basically a folder with a shortcut to the Applications directory but they can be customized with icons, backgrounds, and layout properties. A DMG file (.dmg) is a Mac OS X Disk Image file and it is used to package files or folders providing compression, encryption, and read-only to the package.

##Creating the DMG file #Disk Utility

@akovardin
akovardin / flutter_driver_async_main.dart
Created October 22, 2020 15:40 — forked from Boehrsi/flutter_driver_async_main.dart
During development I encountered https://github.com/flutter/flutter/issues/41029 and didn't liked the solution with hardcoded waiting times. I'm now waiting for the first frame to be rastered successfully and ignoring errors in the meantime. This works well for my tests and avoids hardcoded timings, which often fail (e.g. on a different machine).
Future<FlutterDriver> setupAndGetDriver() async {
FlutterDriver driver = await FlutterDriver.connect();
var connected = false;
while (!connected) {
try {
await driver.waitUntilFirstFrameRasterized();
connected = true;
} catch (error) {}
}
return driver;
@akovardin
akovardin / DownloadAndSaveAudioFile.swift
Created January 19, 2020 21:20 — forked from UmairSharif99/DownloadAndSaveAudioFile.swift
Function to download audio file from url and save it in documents directory
func downloadAndSaveAudioFile(_ audioFile: String, completion: @escaping (String) -> Void) {
//Create directory if not present
let paths = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.libraryDirectory, FileManager.SearchPathDomainMask.userDomainMask, true)
let documentDirectory = paths.first! as NSString
let soundDirPathString = documentDirectory.appendingPathComponent("Sounds")
do {
try FileManager.default.createDirectory(atPath: soundDirPathString, withIntermediateDirectories: true, attributes:nil)
print("directory created at \(soundDirPathString)")
@akovardin
akovardin / gomake.md
Created September 4, 2019 23:15 — forked from rkravchik/gomake.md
Golang alternatives to makefiles.

Go build tasks utilities

Инструментов мало. Тема сообществом мало проработана. Возможно, makefile всех устраивает.

Первая группа: замена утилиты make:

  • makex понимает уже существующие makefiles.

Вторая группа: разнородные инструменты:

  • goxc в своё время популярный сборщик для кроссплатформенной разработки.
@akovardin
akovardin / Makefile
Created October 21, 2018 20:17
Makefile for Go Projects
GOPATH=$(shell pwd)/vendor:$(shell pwd)
GOBIN=$(shell pwd)/bin
GOFILES=$(wildcard *.go)
GONAME=$(shell basename "$(PWD)")
PID=/tmp/go-$(GONAME).pid
build:
@echo "Building $(GOFILES) to ./bin"
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o bin/$(GONAME) $(GOFILES)
@akovardin
akovardin / image-proxy.conf
Created July 11, 2018 11:05 — forked from tmaiaroto/image-proxy.conf
Nginx Image Filter Resize Proxy Service
# Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below).
proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G;
# Gzip was on in another conf file of mine...You may need to uncomment the next line.
#gzip on;
gzip_disable msie6;
gzip_static on;
gzip_comp_level 4;
gzip_proxied any;
# Again, be careful that you aren't overwriting some other setting from another config's http {} section.
@akovardin
akovardin / README.md
Created March 6, 2018 23:12 — forked from rjeczalik/README.md
Go, multiple packages and coveralls.io

Go, multiple packages and coveralls.io

Single profile for single Go package

For Go projects that consist of only one package, the following Travis configuration is enough to get started with coveralls.io. You may want to encrypt your $COVERALLS_TOKEN via Travis encryption keys though.

language: go
go:
 - 1.3.1
@akovardin
akovardin / md5-example.go
Last active July 26, 2018 17:31 — forked from sergiotapia/md5-example.go
Go MD5 string
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}
@akovardin
akovardin / tumblr-download.go
Last active July 2, 2018 20:40 — forked from indraniel/tumblr-download.go
Go and tumblr
/*
This is a go program to download pictures from a tumblr blog page.
To Build:
go build -o tumblr-download tumblr-download.go
To Run:
# download the photos on the first page of tumblr blog
@akovardin
akovardin / smtp-gmail-send.go
Last active February 18, 2019 10:02 — forked from jpillora/smtp-gmail-send.go
Send email using Go via GMail
package main
import (
"log"
"net/smtp"
)
func main() {
send("hello there")
}