Skip to content

Instantly share code, notes, and snippets.

View dimmduh's full-sized avatar
🎮
Learning Unity

Dmitrii Dukhnich dimmduh

🎮
Learning Unity
View GitHub Profile
@dimmduh
dimmduh / app2top.java
Last active September 29, 2017 09:13
App2top event tracking
//Call Apptop.sendEvent(Context context, String eventName) to send event to app2top servers for tracking user actions
//for debuging (tag: APP2TOP)
App2top.debug = true;
//when user complete 45 level
App2top.sendEvent(getApplicationContext(), "Level45");
//when
App2top.sendEvent(getApplicationContext(), "HeroReachedLevel5");
@dimmduh
dimmduh / initClient.php
Created September 13, 2017 02:17
Yii2 http client init with base request params
private function initClient()
{
$this->_client = new Client([
'baseUrl' => $this->host,
'transport' => [
'class' => 'yii\httpclient\CurlTransport'
],
'requestConfig' => [
'options' => [
'timeout' => 1,
@dimmduh
dimmduh / SpritePackerIndex.cs
Created August 19, 2017 12:44
List of textures by atlases made by Unity sprite packer.
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace IOGames.Utils
{
public class SpritePackerIndex : MonoBehaviour
{
String regex = "(([A-Za-z]{3,9}:(?://)?)(?:[-;:&=+$,\\w]+@)?[A-Za-z0-9.-]+|(?:www\\.|[-;:&=+$,\\w]+@)[A-Za-z0-9.-]+)((?:/[+~%/.\\w-]*)?\\??(?:[-+=&;%@.\\w]*)#?(?:[.!/\\\\\\w]*))?";
@dimmduh
dimmduh / ProtobufDispatcher.java
Created August 8, 2017 03:46
MNF ProtobufDispatcher
using System.Collections;
using System.Collections.Generic;
using MNF;
using UnityEngine;
public class ProtobufDispatcher : DefaultDispatchHelper<ProtobufSession>
{
public override bool OnInit()
{
using System;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEngine;
public class ModelExplorerWindow : EditorWindow {
[MenuItem("Window/Example03")]
static void Example3()
@dimmduh
dimmduh / ShaderReplacer.cs
Created March 17, 2017 09:52
automatic replace shader in unity from pc to mobile
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
public class ShaderReplacer : MonoBehaviour {
private static readonly Dictionary<string, Shader> replaceTo = new Dictionary<string, Shader>()
{
{"Legacy Shaders/Diffuse", Shader.Find("Mobile/Diffuse") },
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
#if UNITY_IPHONE || UNITY_STANDALONE_OSX
using UnityEditor.iOS.Xcode;
#endif
using System.IO;
using System.Collections;
/// <summary>
@dimmduh
dimmduh / does not work
Last active January 31, 2017 03:16
crashing native plugin + appmetrica
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="com.io_games.oneshot_sniper_assassin_free_3d_game" platformBuildVersionCode="24" platformBuildVersionName="7.0">
<application android:debuggable="true" android:icon="@drawable/app_icon" android:isGame="true" android:label="@string/app_name">
<service android:enabled="true" android:exported="true" android:name="com.yandex.metrica.MetricaService" android:process=":Metrica">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="com.yandex.metrica.IMetricaService"/>
<data android:scheme="metrica"/>
</intent-filter>
<meta-data android:name="metrica:api:level" android:value="52"/>
@dimmduh
dimmduh / gp_search.php
Last active September 6, 2019 00:40
[Possible DEPRECATED] parsing google play search result via web (search_results_cluster_apps)
<?php
require 'vendor/autoload.php';
require 'utf8_replace.php';
echo "start \n";
$url = "https://play.google.com/store/search?q=racing&c=apps&authuser=0";
$client = new \GuzzleHttp\Client([