Skip to content

Instantly share code, notes, and snippets.

View wizardjedi's full-sized avatar

Sayapin Alexander wizardjedi

View GitHub Profile
@wizardjedi
wizardjedi / css.css
Created March 23, 2019 17:34
simple sidebar
@media screen and (max-width: 801px) {
.wrapper {
display: flex;
flex-direction: column;
width: 100vw;
}
#sidebar {
display: block;
}
@wizardjedi
wizardjedi / bitoperations.js
Created March 11, 2019 17:21
bit operations
console.log("Hello");
var offset = 7;
var ar = [0xfd, 0x23];
var myVal = ar[0]<<8 | ar[1];
console.log(myVal);

JAVA-PHP INTEROP PROTOCOL

{
  "cmd":"NEW",
  "class":"com.someenterprise.SomeClass",
  "args":[
    {
      "type":"int",
 "value":123
CREATE TABLE metrics (
date datetime,
name varchar(250),
value double,
primary key(date, name),
date key(date)
) with partitioning(1s to 7day,1m to 30day,1h to 90day,1day to 2year,1month);
@wizardjedi
wizardjedi / readme.md
Last active April 27, 2018 14:31
Java template engine language description
#if () { 
#}

#for () {
  #if () {
    <Component data="${data}">
      <Field />
    </Component>
 #}
@wizardjedi
wizardjedi / XMLStringBuilder.java
Last active April 1, 2018 08:19
xml writer api
class Main {
public static class XMLStringBuilder {
public static final String OPEN_BRACE = "<";
public static final String CLOSE_BRACE = ">";
public static final String CLOSE_SUFFIX = " />";
public static final String OPEN_CLOSE_TAG = "</";
public static final String ATTR_PREFIX = "=\"";
@wizardjedi
wizardjedi / send.sh
Created January 25, 2018 15:06 — forked from matwey/send.sh
Send binary payloaded message to AMQP unsing rabbitmq rest-api.
#!/bin/sh
BODY='\00\00\00\01\00\00\00\00'
BODY64=$(echo -ne $BODY | base64)
S='{"properties":{},"routing_key":"test","payload":"'$BODY64'","payload_encoding":"base64"}'
echo $S | curl --data-binary @- -i -u guest:guest http://192.168.185.182:15672/api/exchanges/%2f/amq.default/publ ish -X POST
@wizardjedi
wizardjedi / archive.md
Last active January 3, 2018 13:49
Compact log definition

Archive file format

archive:[SCHEMA]
bunch:[SIZE]
[bunch data]
bunch:[SIZE]
[bunch data]
...
bunch:[SIZE]
@wizardjedi
wizardjedi / gist:64053ad1193cfbc5c4c3d1cb0428dd4c
Created May 22, 2017 19:01 — forked from jestan/gist:4411538
MAP Protocol Error Codes

MAP Protocol Error Codes

Generic errors

34 System failure

35 Data Missing

36 Unexpected Data Value

21 Facility Not Supported

#!/usr/bin/env escript
% -*- mode: erlang -*-
main([BeamFile]) ->
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]),
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).