Skip to content

Instantly share code, notes, and snippets.

View zhanser1k's full-sized avatar
:octocat:
Working hard

Zhanserik zhanser1k

:octocat:
Working hard
View GitHub Profile
@zhanser1k
zhanser1k / random.js
Created April 21, 2021 12:47
Random ID Generation Function
function getRandomId() {
return (
Date
.now()
.toString(36) +
Math
.random()
.toString(36)
.substr(2, 5))
.toUpperCase();
@zhanser1k
zhanser1k / emulator-install-using-avdmanager.md
Created July 27, 2020 16:55 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

Задержка смены раскладки клавиатуры
**1.** Качаем скрипт: [https://github.com/yamnikov-oleg/switch-layout](https://github.com/yamnikov-oleg/switch-layout)
**2.** Устанавливаем pip:
```
sudo apt install python3-pip
```
@zhanser1k
zhanser1k / power.sh
Last active April 1, 2018 18:46
Bash script for laptop-mode. файл power.sh нужно закинуть в директорию /etc/acpi/. И нужно на этот файл дать права на запуск: $ sudo chmod +x /etc/acpi/power.sh. Затем нужно перезагрузить комп. После чего он будет запускаться при каждой загрузке ОС.
#!/bin/sh
if on_ac_power; then
echo 0 > /proc/sys/vm/laptop_mode
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
echo max_performance > /sys/class/scsi_host/host0/link_power_management_policy
echo max_performance > /sys/class/scsi_host/host1/link_power_management_policy
echo max_performance > /sys/class/scsi_host/host2/link_power_management_policy
echo max_performance > /sys/class/scsi_host/host3/link_power_management_policy
echo max_performance > /sys/class/scsi_host/host4/link_power_management_policy
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
@zhanser1k
zhanser1k / things-after.sh
Last active February 23, 2018 06:29
Things To Do After Installing Elementary
#!/bin/bash
sudo apt update &&
sudo apt upgrade -y &&
#---GDEBI---
sudo apt install -y gdebi &&
#---SOFTWARE-PROPERTIES-COMMON for adding third-party repos
sudo apt install -y software-properties-common &&
#---Elementary Tweaks---
sudo add-apt-repository -y ppa:philip.scott/elementary-tweaks &&
sudo apt update &&
@zhanser1k
zhanser1k / modalService.js
Created June 1, 2017 02:56
promise for modal action
(function (angular) {
'use strict';
angular.module('app').factory('modalService', function ($uibModal) {
var opened = false;
var successCallback, errorCallback, finallyCallback;
var thenFunction = function (success, error) {
successCallback = success;
errorCallback = error;