Skip to content

Instantly share code, notes, and snippets.

View morj's full-sized avatar

Pavel Nikitin morj

  • JetBrains
  • Munich, Germany
View GitHub Profile
hello.init({
//facebook : FACEBOOK_CLIENT_ID,
//windows : WINDOWS_CLIENT_ID,
google: '1019509210439-07d7lk737mmadt5cmd0cdctk5q0n1qkk.apps.googleusercontent.com'
}, {
redirect_uri: 'oauth.html'
}
);
var online = function (session) {
if (session) {
package sandbox;
import org.jetbrains.annotations.Nullable;
import java.util.concurrent.atomic.AtomicLong;
public class MetricInstance {
private final long period;
private MetricsState state = new MetricsState(System.currentTimeMillis(), 0, null);
@morj
morj / demo
Last active November 6, 2015 14:22
#!/bin/bash
# usage: ./demo <service secret>
# also, set your UUIDs below
HUB_URL="http://localhost:8080/hub"
YOUTRACK_URL="http://localhost:8080"
YOUTRACK_SERVICE="6b6adb20-e08b-41c1-bbc9-008720a2198a"
ROOT_SERVICE_ID="d02309cb-d677-4eb6-badd-0bf092a26a74"
ROOT_SERVICE_SECRET=$1
@morj
morj / cleanup.sh
Last active December 8, 2015 13:44
#!/bin/bash
git config --global pack.windowMemory "512m"
git config --global pack.packSizeLimit "512m"
JAVA_HOME=~/jdk1_8_x64
$JAVA_HOME/bin/java -version
git clone --mirror git+ssh://git@git.labs.intellij.net/youtrack
#include <jni.h>
#include <string>
#include <sys/ioctl.h>
#include <android/log.h>
#include <linux/usbdevice_fs.h>
#define APPNAME "IOTKBD"
using namespace System;
using namespace std;
@morj
morj / mosh-kbd.cc
Last active October 27, 2016 17:30
extern "C" {
JNIEXPORT void JNICALL
Java_com_github_morj_iotkbd_MainActivity_notifyDeviceAttached(JNIEnv *env, jclass type, jint fd,
jint endp) {
__android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "Device attached: %d, endp: %d", fd, endp);
Base64Key key("X12345678901234567890A");
//Session session(key);
sockaddr_in si_other;
@morj
morj / enhance.py
Last active December 5, 2016 12:43
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" _ _
_ __ ___ _ _ _ __ __ _| | ___ _ __ | |__ __ _ _ __ ___ ___
| '_ \ / _ \ | | | '__/ _` | | / _ \ '_ \| '_ \ / _` | '_ \ / __/ _ \
| | | | __/ |_| | | | (_| | | | __/ | | | | | | (_| | | | | (_| __/
|_| |_|\___|\__,_|_| \__,_|_| \___|_| |_|_| |_|\__,_|_| |_|\___\___|
"""
#
typealias LArray1 = Array<LongArray?>
typealias LArray2 = Array<LArray1?>
typealias LArray3 = Array<LArray2?>
typealias LArray4 = Array<LArray3?>
typealias LArray5 = Array<LArray4?>
typealias LArray6 = Array<LArray5?>
@Suppress("ConvertTwoComparisonsToRangeCheck")
class LongBitTree : Iterable<Long> {
@Suppress("NOTHING_TO_INLINE")
hello.init({
vk : {
name : 'vk',
oauth : {
version : 2,
auth : 'https://oauth.vk.com/authorize',
grant : 'https://oauth.vk.com/access_token'
},
scope : {
open class SuspendAwareThrowable(message: String?) : Throwable(message) {
companion object : KLogging()
private val _cause = AtomicReference<Throwable>(null)
override fun fillInStackTrace(): Throwable {
return if (logger.isDebugEnabled) {
super.fillInStackTrace()
} else {
this