Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexey Gulev AGulev

View GitHub Profile
View iaps.lua
local cfg = require "modules.onet.config"
local msgs = require "modules.msgs"
local M = {}
local list = {}
local callback_function
local function iap_listener(self, transaction, error)
if error == nil then
@AGulev
AGulev / swipe_mouse.lua
Created Jul 29, 2016
adoptation of swipe-direction script by ScottPhillips https://github.com/ScottPhillips/swipe-direction/blob/master/swipe-direction.lua for Defold engine using mouse_trigger instead touch_trigger
View swipe_mouse.lua
local beginX
local beginY
local endX
local endY
local startTime = 0
local xDistance
local yDistance
@AGulev
AGulev / swipe.lua
Last active Nov 22, 2021
adoptation of swipe-direction script by ScottPhillips https://github.com/ScottPhillips/swipe-direction/blob/master/swipe-direction.lua for Defold engine
View swipe.lua
local beginX
local beginY
local endX
local endY
local startTime
local xDistance
local yDistance
View uptime.lua
function M.check_keys(callback)
local max_keys = data.BALANCE.CONST.max_key_counts[wallet.max_key_index]
if wallet.keys < max_keys then
local dif = 0
local time_key
if uptime then
time_key = "last_key_use_time_cpu"
dif = uptime.get() - wallet.last_key_use_time_cpu + 1
end
if dif <= 0 then
@AGulev
AGulev / duplicates_finder.py
Last active Sep 1, 2021
Python script for a searching duplicate files in folder. Modification of: https://www.pythoncentral.io/finding-duplicate-files-with-python/ (file size counter was added)
View duplicates_finder.py
# dupFinder.py
import os, sys, stat
import hashlib
def findDup(parentFolder):
# Dups in format {hash:[names]}
dups = {}
for dirName, subdirs, fileList in os.walk(parentFolder):
print('Scanning %s...' % dirName)
for filename in fileList:
@AGulev
AGulev / bundle.sh
Last active Dec 10, 2020 — forked from britzl/bundle.sh
Script to build and bundle a Defold project for multiple platforms
View bundle.sh
#!/bin/bash
readonly java_path='java'
readonly output_path='build'
readonly email='my@email.com'
readonly auth_key='my_key'
readonly texture_compresstion='false'
readonly andr_key_path='key.pk8'
readonly andr_cert_path='certificate.pem'
@AGulev
AGulev / gist:f1d4ad5d695211cc27b7f11490fa96fb
Last active Apr 13, 2019
Exchange rate National Bank of the Republic of Belarus in Google Sheets
View gist:f1d4ad5d695211cc27b7f11490fa96fb
Формула:
=IMPORTXML(CONCATENATE("http://www.nbrb.by/Services/XmlExRates.aspx?ondate=", TEXT(A1,"mm/dd/yyyy")),"/DailyExRates/Currency[@Id='145']/Rate/text()")
Нужно заменить A1 ячейкой с датой.
Валюты:
145 - USD
292 - EUR
298 - RUB
View .luacheckrc
std = "max"
files['.luacheckrc'].global = false
unused_args = false
globals = {
"sys",
"go",
"gui",
"label",
"render",
@AGulev
AGulev / CustomEditorBase.cs
Created Apr 3, 2016 — forked from t0chas/CustomEditorBase.cs
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
View CustomEditorBase.cs
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
@AGulev
AGulev / builder.py
Created Apr 28, 2018 — forked from Jerakin/builder.py
For building and deploying Defold projects directly to your phone
View builder.py
"""
Builder is built by wrapping adb and storing some data locally
I would recommend to add an alias to your ~.bash_profile to use it easier
alias builder="python3.5 ~/Documents/repo/builder/builder.py"
Usage:
builder.py [command] [arguments]
Available Commands: