Skip to content

Instantly share code, notes, and snippets.

View andrievsky's full-sized avatar

Nick Andrievsky andrievsky

  • Munich, Germany
View GitHub Profile
#!/bin/sh
#ifconfig
#dhclient -r wlp7s0
#dhclient wlp7s0
ADAPTER_ID=$(ifconfig | grep -o "\w*wl\w*")
if [ -z "$ADAPTER_ID" ]
then
echo "No wl* adapters found"
else
@andrievsky
andrievsky / AssetUri.cs
Last active February 12, 2019 10:08
Serialize asset string uri instead of Unity reference to decouple assets from each other and improve loading performance.
using System;
using UnityEngine;
using Object = UnityEngine.Object;
#if UNITY_EDITOR
using UnityEditor;
#endif
/**
* Usage
import timeit
COUNT = 1000
CITIES = []
for i in range(COUNT):
CITIES.append("city_" + str(i))
def testWithoutTuples(cities):
res = 0
@andrievsky
andrievsky / sort-arrays.as
Last active January 15, 2016 08:12
Extra task. Sort arrays
/***
Extra task. Write method that takes two sorted arrays of integers (can be of any range, numbers can
repeat, sizes of arrays can be different) and returns array of n + m length which is sorted in the same
order. Do not use any type of built-in sorting.
*/
function sort(array1:Array, array2:Array):Array{
if(array1.length === 0) return array2;
if(array2.length === 0) return array1;
var compare:Function = (array1[0] < array1[array1.length - 1] || array2[0] < array2[array1.length - 1] ) ? isSmaller : isBigger;
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.js"></script>
<meta charset=utf-8 />
</head>
<body>