Skip to content

Instantly share code, notes, and snippets.

View SammyVimes's full-sized avatar
🗿
I am a teapot

Semyon Danilov SammyVimes

🗿
I am a teapot
  • YDB
  • Tenured Generation Heap
View GitHub Profile
@SammyVimes
SammyVimes / Ozon.js
Created April 9, 2018 08:57
Literature sources generator
var $ = jQuery;
function getProp(propName) {
var props = "";
$(".eItemProperties_name").each(function(i, e){
if ($(e).text().indexOf(propName) != -1) {
props = $($(e).siblings()[0]).text().replace(/\s+/g, " ").trim();
}
});
return props;
}
@SammyVimes
SammyVimes / poc.java
Created October 5, 2017 12:34
Finding specific button in window via AccessibilityService
public static AccessibilityNodeInfo findNoButton(final AccessibilityNodeInfo source, final String keyword) {
Queue<AccessibilityNodeInfo> queue = new ArrayDeque<>();
if (source == null) {
return null;
}
queue.add(source);
while (!queue.isEmpty()) {
AccessibilityNodeInfo cur = queue.poll();
for (int i = 0; i < cur.getChildCount(); i++) {
AccessibilityNodeInfo child = cur.getChild(i);
@SammyVimes
SammyVimes / plan.md
Last active May 30, 2017 20:04
Plan for summer android course

План для доклада

Тема: "Хранение данных"

  1. Когда нужно хранить данные
  2. Как можно хранить данные
    2.1 Файлики
    • Картинки, музыка, etc.
    • Можно хранить на карте памяти (общая память), можно в приватной папке приложения (тут можно ввернуть про владельца папки приложения в linux).
    • Постоянное хранение/кэш

2.2 SharedPreference

# import the necessary packages
import numpy as np
import imutils
import cv2
class Stitcher:
def __init__(self):
# determine if we are using OpenCV v3.X
self.isv3 = imutils.is_cv3()
@SammyVimes
SammyVimes / ^Regexes$.md
Last active May 30, 2017 19:10
My top regexes

1. Negative lookahead

^(?!.*NotThisWord).*OnlyThisWord.*$

@SammyVimes
SammyVimes / GlossyModelGenerator.es6
Last active January 27, 2017 14:41
GlossyModelGenerator for swift
glossGenerator("CLChatFile", {
id: "Int64",
regDate: "Date",
ownerId: "Int64?",
filename: "String",
mimeType: "String",
length: "Int64",
md5: "String"
})
# for randomly dropping 10% of incoming packets:
iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP
# and for dropping 10% of outgoing packets:
iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROP
function WindowController () {
this.id = Math.random();
this.isMaster = false;
this.others = {};
window.addEventListener( 'storage', this, false );
window.addEventListener( 'unload', this, false );
this.broadcast( 'hello' );
@SammyVimes
SammyVimes / immersion.java
Last active September 28, 2016 15:55
ффф
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
// логика
}
private void toggleFullscreen(final boolean fullscreen) {
getSupportActionBar().hide();
if (fullscreen) {
if (Build.VERSION.SDK_INT >= 19) {
#version 330 core
out vec4 FragColor;
in vec2 TexCoords;
uniform sampler2D image;
uniform bool horizontal;
uniform float weight[5] = float[] (0.2270270270, 0.1945945946, 0.1216216216, 0.0540540541, 0.0162162162);
void main()