This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* INCLUDES *******************************************************************/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
/* TYPES **********************************************************************/ | |
#define BYTE unsigned char | |
#define PBYTE BYTE* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define GET_BYTE(val, n) (((val) >> (8*(n))) & 0xFF) | |
#define GET_BYTE_FROM_END(val, n) (((val) >> (8*(sizeof((val)) - 1 - (n)))) & 0xFF) | |
#define BSWAP16(val) \ | |
( (((val) >> 8) & 0x00FF) | (((val) << 8) & 0xFF00) ) | |
#define BSWAP32(val) \ | |
( (((val) >> 24) & 0x000000FF) | (((val) >> 8) & 0x0000FF00) | \ | |
(((val) << 8) & 0x00FF0000) | (((val) << 24) & 0xFF000000) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put it in your Activity and it'll apply to all EditTexts including those within fragments within that activity | |
override fun dispatchTouchEvent(event: MotionEvent): Boolean { | |
if (event.action == MotionEvent.ACTION_DOWN) { | |
val v = currentFocus | |
if (v is EditText) { | |
val outRect = Rect() | |
v.getGlobalVisibleRect(outRect) | |
if (!outRect.contains(event.rawX.toInt(), event.rawY.toInt())) { | |
v.clearFocus() | |
val imm: InputMethodManager = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect(('SERVER', 80)) | |
while True: | |
raw = s.recv(1024) | |
print(raw.decode('ascii')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import time | |
SERVER_ADDRESS = ('localhost', 2353) | |
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
server_socket.bind(SERVER_ADDRESS) | |
server_socket.listen(1) | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using DiscUtils; | |
using DiscUtils.Ntfs; | |
using DiscUtils.Partitions; | |
using DiscUtils.Streams; | |
using DiscUtils.Vhdx; | |
namespace App | |
{ | |
internal class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
money = 0 | |
with open("raw.txt", encoding="utf-8") as f: | |
for line in f.readlines(): | |
if "YANDEX.TAXI" not in line: | |
continue | |
data = line.strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mqtt | |
import kotlinx.coroutines.suspendCancellableCoroutine | |
import org.eclipse.paho.android.service.MqttAndroidClient | |
import org.eclipse.paho.client.mqttv3.* | |
import timber.log.Timber | |
import kotlin.coroutines.resume | |
suspend inline fun MqttAndroidClient.awaitConnectWith( | |
crossinline options: MqttConnectOptions.() -> Unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- See: --> | |
<!-- https://medium.com/omisoft/textinputlayout-styling-8b36a5e0d73c --> | |
<!-- Style and color must be placed into different files --> | |
<!-- Style --> | |
<style name="TextInputLayoutStyle" parent="Widget.MaterialComponents.TextInputLayout.FilledBox"> | |
<item name="hintTextColor">@color/input_box_color</item> | |
<item name="passwordToggleTint">@color/input_box_color</item> | |
<item name="boxStrokeColor">@color/input_box_color</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Реклама групп с пометкой рекламы | |
vk.com#?##page_wall_posts > div[id^="post-"]:-abp-has(.wall_marked_as_ads) | |
# Реклама интересных авторов | |
vk.com#?##page_wall_posts > div[id^="post-"]:-abp-has(.wall_authors_rec) | |
# Рекомендации в ленте | |
vk.com##.feed_friends_recomm | |
vk.com###profile_friends_recomm |
OlderNewer