Skip to content

Instantly share code, notes, and snippets.

View ColCh's full-sized avatar

Max Sysoev ColCh

  • Microsoft
  • Belgrade, Serbia
  • LinkedIn in/colch
View GitHub Profile
@ColCh
ColCh / PSReadlineProfile.ps1
Created March 16, 2023 16:50 — forked from kelbyers/PSReadlineProfile.ps1
powershell to behave somewhat like bash
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
### shamelessly copied from https://raw.githubusercontent.com/lzybkr/PSReadLine/master/PSReadLine/SamplePSReadLineProfile.ps1
# This is an example profile for PSReadLine.
#
# This is roughly what I use so there is some emphasis on emacs bindings,
# but most of these bindings make sense in Windows mode as well.
@ColCh
ColCh / remap.ahk
Created February 7, 2023 12:36
Windows: Remap Alt+Arrow to move cursor like MacOS
; https://superuser.com/a/1015744/404619
!Left::Send("{Home}")
!Right::Send("{End}")
!+Left::Send("{Shift down}{Home}{Shift up}")
!+Right::Send("{Shift down}{End}{Shift up}")

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

#!/bin/sh
# ------------
# Profile: GPU
# ------------
echo 578000000 > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/max_gpuclk
echo simple_ondemand > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/devfreq/governor
echo 15 > /sys/module/adreno_idler/parameters/adreno_idler_downdifferential
echo 15 > /sys/module/adreno_idler/parameters/adreno_idler_idlewait
echo 6000 > /sys/module/adreno_idler/parameters/adreno_idler_idleworkload
@ColCh
ColCh / README.md
Last active September 26, 2024 08:12
Git pre-push hook to confirm pushing to master
@ColCh
ColCh / app.js
Created February 24, 2017 13:25
catch errors and send 'em to Crashlytics in React Native
// WARNING: SIDE-EFFECTS. ONLY FOR PROD VERSION
if (!__DEV__) {
require('./utils/log.js');
}
// SIDE-EFFECTS END
@ColCh
ColCh / main.js
Created February 22, 2017 11:28
Copy new branch name to clipboard on issue page in GitLab
(function () {
try {
var newBranchButton = document.querySelector('#new-branch > a.available');
var title = newBranchButton.title || newBranchButton.dataset.originalTitle;
if (!title) {
alert("Can't find New Branch button");
return;
}
var copied = false;
try {
@ColCh
ColCh / README.md
Last active April 5, 2022 12:06
Create merge request on Gitlab in command line for current branch

Gitlab merge request script

Creates merge request on Gitlab for you

Installation

Download it, add executable perms and place into PATH:

# Place it into ~/.bin
mkdir ~/.bin
@ColCh
ColCh / Provision-android-sdk.sh
Created December 10, 2015 22:54
Install puppet, java and android-sdk
#!/bin/bash
# Installs puppet, java and android-sdk
curl -sS https://raw.githubusercontent.com/hashicorp/puppet-bootstrap/master/ubuntu.sh | sh
puppet module install 7terminals-java
puppet module install maestrodev-android
manifest_path="/tmp/manifest-sdk.pp"
@ColCh
ColCh / Brief.md
Last active October 22, 2015 17:47
Max Quest

В основе: Написать реализацию EventEmitter с некоторыми улучшениями и примесь для использования его API. Сам EventEmitter - глобальный синглетон.

API класса:

  • emit(eventName, payload): инициирует событие eventName с данными payload
  • on(eventName, handler): подписывает обработчик события handler на событие eventName.
  • off(eventName, handler): отписывает обработчик события handler от события eventName

Пример использования:

const EventEmitter = ...