Skip to content

Instantly share code, notes, and snippets.

View romasks's full-sized avatar

Raman Skaskevich romasks

View GitHub Profile
@romasks
romasks / ShowDebugKeyFingerprints.sh
Created February 16, 2020 22:29 — forked from j796160836/ShowDebugKeyFingerprints.sh
Show android debug key's fingerprints. (MD5 / SHA1 / SHA256)
#!/bin/bash
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
@romasks
romasks / RxSchedulers.java
Created February 11, 2020 09:42 — forked from guelo/RxSchedulers.java
Dagger injected Rx schedulers
import javax.inject.Named;
import javax.inject.Singleton;
import io.reactivex.Observable;
import io.reactivex.ObservableTransformer;
import io.reactivex.Scheduler;
@Singleton
public class RxSchedulers {
@romasks
romasks / VKLoginActivity.java
Created April 27, 2019 11:46
VK login using OAuth
package net.example.ui;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.view.View;
@romasks
romasks / webpacker_rails.md
Created October 26, 2018 05:53 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
# The goal of this problem is to extract headers from a block of text,
# and arrange them hierarchically.
#
# See the specs for more detail on the output
def header_hierarchy(html)
raise "TODO"
end
describe '#header_hierarchy' do
@romasks
romasks / remote_bash.sh
Created November 1, 2017 14:06 — forked from n0ts/remote_bash.sh
execute bash script from remote site
# http://stackoverflow.com/questions/5735666/execute-bash-script-from-url
bash <(curl -s http://mywebsite.com/myscript.txt)
# http://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl
curl http://foo.com/script.sh | bash -s arg1 arg2
#!/usr/bin/env bash
curl -v -H "X-Papertrail-Token: 2g8d9d0SPIoZcKXktps3" 'https://papertrailapp.com/api/v1/events/search.json?q=Please%20use%20the%20following%20password' > 'before.json'
min=$(("$(jq -r '.max_id' before.json)" + 1))
curl -v -H "X-Papertrail-Token: 2g8d9d0SPIoZcKXktps3" 'https://papertrailapp.com/api/v1/events/search.json?q=initialAdminPassword' > 'after.json'
max=$(("$(jq -r '.min_id' after.json)" - 1))
curl -v -H "X-Papertrail-Token: 2g8d9d0SPIoZcKXktps3" "https://papertrailapp.com/api/v1/events/search.json?min_id=$min&max_id=$max" > 'pwd.json'
pswd=$(("$(jq -r '.events.message' after.json)" - 1))
FROM jenkins/jenkins:lts
#RUN /usr/local/bin/install-plugins.sh gitlab-plugin publish-over-dropbox
@romasks
romasks / other .gitlab-ci.yml
Created March 21, 2017 08:20 — forked from daicham/.gitlab-ci.yml
A sample of .gitlab-ci.yml for a gradle project
image: java:8-jdk
stages:
- build
- test
- deploy
before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
package com.javarush.test.level09.lesson11.bonus03;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
/* Задача по алгоритмам
Задача: Пользователь вводит с клавиатуры список слов (и чисел). Слова вывести в возрастающем порядке, числа - в убывающем.
Пример ввода: