Skip to content

Instantly share code, notes, and snippets.

View dzhulk's full-sized avatar

Murat Dzhulkuttiev dzhulk

  • St. Petersburg, Russia
View GitHub Profile
@dzhulk
dzhulk / cheatsheet.rb
Created July 11, 2024 15:50 — forked from mabenson00/cheatsheet.rb
Rails Postgres ActiveRecord JSON cheatsheet
# Basic key operators to query the JSON objects :
# #> : Get the JSON object at that path (if you need to do something fancy)
# -> : Get the JSON object at that path (if you don't)
# ->> : Get the JSON object at that path as text
# {obj, n} : Get the nth item in that object
# https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE
# Date
# date before today
@dzhulk
dzhulk / The Technical Interview Cheat Sheet.md
Created October 14, 2016 17:28 — forked from kapkaev/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
package main
import java.util.concurrent.ConcurrentHashMap
import akka.actor._
import io.netty.bootstrap.ServerBootstrap
import io.netty.buffer.Unpooled
import io.netty.channel.nio.NioEventLoopGroup
import io.netty.channel.socket.SocketChannel
import io.netty.channel.socket.nio.NioServerSocketChannel
@dzhulk
dzhulk / build.sm
Last active August 29, 2015 14:07 — forked from dmalikov/build.sm
target hw1
sources
hw1.mlb
hw1.main.sml
end
option compiler = mlton
option output = hw1
end
cd ruby_build
git pull
./install.sh
CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` ruby-build --keep rbx-2.2.9 ~/.rubies/rbx
(def common-words (-> (slurp "http://www.textfixer.com/resources/common-english-words-with-contractions.txt")
(clojure.string/split #",")
set))
(def text (slurp "http://www.clearwhitelight.org/hitch/hhgttg.txt"))
(->> text
(re-seq #"[\w|']+")
(map #(clojure.string/lower-case %))
(remove common-words)
@dzhulk
dzhulk / test.rb
Last active August 29, 2015 14:00
class A
CONST = [1,2,3]
def call_it
CONST
end
def call_it2
self.class::CONST
end
@dzhulk
dzhulk / main.py
Last active August 29, 2015 14:00
werty12?asdfg///?0987asdfghrexesx5
werty12/asdfg//!/0987asdfghrexesx