Skip to content

Instantly share code, notes, and snippets.

View zenVentzi's full-sized avatar
👊

zen-ventzi-marinov zenVentzi

👊
View GitHub Profile
@zenVentzi
zenVentzi / .tmux.conf
Created July 1, 2022 18:50
setup tmux like vim + other settings
## ------------------
## General Settings
## ------------------
# make tmux display things in 256 colors
set -g default-terminal "screen-256color"
# set scrollback history to 10000 (10k)
set -g history-limit 10000
# set ` as the default prefix key combination
@zenVentzi
zenVentzi / init.vim
Last active July 11, 2022 08:31
vim config file
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
" Install vim-plug if not found
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
import styled from "styled-components";
import React, { useRef, useLayoutEffect, useState } from "react";
import ReactDOM from "react-dom";
import shortid from "shortid";
// https://stackoverflow.com/a/42337722/4132182
function getNodeIndex(element: Element) {
if (!element.parentNode) {
throw Error("parent node not found");
}
USE TSql
GO
/*1 Create a database with two tables: Persons(Id(PK), FirstName, LastName, SSN)
and Accounts(Id(PK), PersonId(FK), Balance). Insert few records for testing.
Write a stored procedure that selects the full names of all persons.*/
CREATE TABLE Persons
(
[Id] INT IDENTITY,
USE TelerikAcademy
--1. names and salaries of the employees that take the minimal salary
--use nested SELECT
SELECT FirstName, Salary FROM Employees
GROUP BY FirstName, Salary
HAVING Salary = (SELECT MIN(Salary) FROM Employees);
--2. find the names and salaries of the employees that have a salary
--that is up to 10% higher than the minimal salary for the company.
USE TelerikAcademy
SELECT *FROM Employees
SELECT FirstName + '.' + LastName + '@telerik.com' AS [Full Email Adress] FROM Employees
SELECT DISTINCT Salary FROM Employees
SELECT FirstName, JobTitle FROM Employees
WHERE JobTitle = 'Sales Representative'