Skip to content

Instantly share code, notes, and snippets.

View Zhomart's full-sized avatar
🏠
Working from home

Zhomart Mukhamejanov Zhomart

🏠
Working from home
View GitHub Profile
package main
import (
"fmt"
"io"
"log"
"net"
"os"
"strings"
)
@Zhomart
Zhomart / Client.java
Created January 24, 2025 05:28
Http client/server example - java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
class Client {
public static void main(String[] args) {
// main thread
@Zhomart
Zhomart / load-parse.js
Created November 24, 2024 19:30
load-parse.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.load = void 0;
const load_js_1 = require("./load.js");
const parse_js_1 = require("./parse.js");
const parse5_adapter_js_1 = require("./parsers/parse5-adapter.js");
const dom_serializer_1 = __importDefault(require("dom-serializer"));

Keybase proof

I hereby claim:

  • I am zhomart on github.
  • I am zhomart (https://keybase.io/zhomart) on keybase.
  • I have a public key ASAWLQCYKhhq_Ze2i4WptYc4IpFq3V-HV4NMCLiTNJQ9jgo

To claim this, I am signing this object:

@Zhomart
Zhomart / filebeat-index-template.json
Last active February 20, 2018 14:07 — forked from thisismitch/filebeat-index-template.json
Fix for elastic 6.0. Run: `curl -XPUT 'http://localhost:9200/_template/filebeat?pretty' -d@filebeat-index-template.json -H "Content-Type: application/json"`
{
"mappings": {
"_default_": {
"dynamic_templates": [
{
"template1": {
"mapping": {
"doc_values": true,
"ignore_above": 1024,
"index": "not_analyzed",

Keybase proof

I hereby claim:

  • I am zhomart on github.
  • I am zhomart (https://keybase.io/zhomart) on keybase.
  • I have a public key ASAALqo70nrARE9pLkoC9BV9SdioRXXW2GrhXLQziu3fRQo

To claim this, I am signing this object:

  1. Try going to each 8 direction, from queens position, until you face obstacle and just count
  2. I used set to check if movement hit the ostacle
defmodule Solution do

  def count(_, qr, qc, _, _) when qr == 0 or qc == 0, do: 0
  def count(n, qr, qc, _, _) when qr == n+1 or qc == n+1, do: 0
  def count(n, qr, qc, obs, speed) do
    if MapSet.member?(obs, {qr, qc}) do # if obstacle
@Zhomart
Zhomart / tensorflow-cpu.sh
Last active November 20, 2017 06:25
Compile and install tensorflow on Ubuntu 16.04. You might want to create a virtual machine on GCP, AWS, then compile tensorflow there. And then download compiled `*.wheel` file for further using it. List of compiled tensorflow with different options can be found here https://github.com/yaroslavvb/tensorflow-community-wheels/issues.
#!/bin/bash
##
## FROM https://github.com/floydhub/dl-docker
##
## Before running the script change versions and compilation flags below.
## If you're having trouble running the whole script, try running
## each command separately.
##
## List of compiled tensorflow packages https://github.com/yaroslavvb/tensorflow-community-wheels/issues
$ crystal spec spec/repo_spec.cr --error-trace --debug -s -t
Parse: 00:00:00.0005730 ( 0.19MB)
Semantic (top level): 00:00:00.1976770 ( 42.18MB)
Semantic (new): 00:00:00.0020550 ( 42.18MB)
Semantic (type declarations): 00:00:00.0269830 ( 50.18MB)
Semantic (abstract def check): 00:00:00.0010410 ( 50.18MB)
Semantic (ivars initializers): 00:00:00.0054870 ( 50.18MB)
Semantic (cvars initializers): 00:00:00.0116270 ( 50.18MB)
Semantic (main): 00:00:01.0783550 ( 202.62MB)
Semantic (cleanup): 00:00:00.0008790 ( 202.62MB)
@Zhomart
Zhomart / setup-monit.yml
Created November 21, 2016 01:18
Ansible monit install script
---
# monit_version = '5.20.0'
- command: /usr/local/bin/monit --version
changed_when: False
failed_when: False
register: installed_monit