Skip to content

Instantly share code, notes, and snippets.

View KowalczykBartek's full-sized avatar

Bartek Kowalczyk KowalczykBartek

View GitHub Profile
$.ajax({
type: 'GET',
url: '/xxoxoxoxoxoxo',
dataType: 'json',
success: function (data) {
$.each(data, function(index, element) {
console.log(element);
var html =`<a href="/${element["mockId"]}" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
@KowalczykBartek
KowalczykBartek / hex_to_string.asm
Last active June 10, 2019 19:03
print numberic value from given register as hex on the screen
; Super highly inspired by https://gist.github.com/kthompson/957c635d84b7813945aa9bb649f039b9
[org 0x7c00]
mov dx, 0x1fb6 ; set function argument
call print_hex ; call the function
jmp $
; arg0: dx - numeric value to be printed in hexdecimal format
print_hex:
[org 0x7c00]
mov bx, HELLO_MSG
call print_string
mov bx, GOODBYE_MSG
call print_string
jmp $
[org 0x7c00]
mov bx, GOODBYE_MSG
call print_string
mov bx, HELLO_MSG
call print_string
jmp infinite_loope
@KowalczykBartek
KowalczykBartek / configuration-file.yaml
Created August 7, 2018 19:45
configuration-file.yaml
dyn_o_mite:
dyn_listen: 127.0.0.1:8101
listen: 127.0.0.1:8102
servers:
- 127.0.0.1:8888:1
tokens: 437425602
data_store: 1
stats_listen: 0.0.0.0:22222
@KowalczykBartek
KowalczykBartek / Dynomite dockerfile
Created August 7, 2018 19:44
Dynomite Dockerfile
FROM ubuntu:latest
MAINTAINER Bartek Kowalczyk "[email protected]"
RUN apt-get update -y
RUN apt-get install gdb -y
RUN apt-get install telnet -y
RUN apt-get install redis-server -y
RUN apt-get install memcached -y
RUN apt-get install -y autoconf build-essential dh-autoreconf git libssl-dev libtool -y
RUN git clone https://github.com/KowalczykBartek/dynomite.git
INFO: [id: 0xd5b26ba6, L:/127.0.0.1:65095 - R:/127.0.0.1:7000] WRITE: 68B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 00 00 01 00 34 00 00 00 8a 55 b0 a1 3d 02 d4 6a |....4....U..=..j|
|00000010| 0c 00 00 00 00 00 06 00 08 00 04 00 06 00 00 00 |................|
|00000020| 04 00 00 00 18 00 00 00 47 45 54 20 2f 73 6f 6d |........GET /som|
|00000030| 65 74 68 69 6e 67 2f 20 54 68 72 65 61 64 2d 34 |ething/ Thread-4|
|00000040| 00 00 00 00 |.... |
+--------+-------------------------------------------------+----------------+
public class WebSocketMessageHandler extends SimpleChannelInboundHandler<WebSocketFrame> {
private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketMessageHandler.class);
private static final ChannelGroup allChannels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
@Override
protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) throws Exception {
if (frame instanceof TextWebSocketFrame) {
@KowalczykBartek
KowalczykBartek / references.java
Last active March 29, 2018 07:26
Some notes about WeakReference SoftReference and PhantomReference in Java
/*
If you were looking for information about Weak/Soft or Phantom references, you probably found this blog post
https://web.archive.org/web/20061130103858/http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html
This is great piece of knowledge, but there is one statement that not necessarily is true.
Lets consider this paragraph in context of Java 7/8
"PhantomReferences are enqueued only when the object is physically removed from memory,
and the get() method always returns null specifically to prevent you from being able to "resurrect" an almost-dead object."
This is true that get() method of PhantomReference always returns null, but this is not true that object is enqueued only
@KowalczykBartek
KowalczykBartek / iamcurious.java
Last active September 12, 2017 18:16
Netty - misleading comment
Lets consider this simple code snippet :
final EventLoopGroup group = new NioEventLoopGroup(1);
group.execute(new Runnable()
{
@Override
public void run()
{
{
Bootstrap b = new Bootstrap();