Skip to content

Instantly share code, notes, and snippets.

View KhodeN's full-sized avatar

Artem Berezin KhodeN

View GitHub Profile
composes
flex-grow
display
content
align-content
align-items
align-self
flex
flex-flow
flex-basis
@KhodeN
KhodeN / index.html
Last active June 21, 2018 10:35
Converter markdown multilevel list to jasmine/mocha tests structure http://jsbin.com/qahurad
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<table>
<tr>
import re
import unittest
from unittest import TestCase
def striptags(html, *tags):
result = html
for tag in tags:
result = re.sub(r'<{tag}>.+?</{tag}>'.format(tag=tag), r'', result)
return result
@KhodeN
KhodeN / ssl_smtp_example.go
Created May 9, 2018 02:56 — forked from chrisgillis/ssl_smtp_example.go
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
package main
import (
"encoding/json"
"fmt"
)
// Int64Array в json может быть представлен и массивом и одним значением sic!
type Int64Array struct {
Values []int64
class MySuperService {
cache: {
[key:string] : Observable<IMyEntity>
} = {};
getItem(id number){
let promise = this.cache[id];
if (!promise){
promise = this._http.get<IMyEntity>('/entities');
this.cache[id] = promise;
@KhodeN
KhodeN / psql_table_sizes.sql
Created March 30, 2018 03:58
Postgres table size in bytes
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_relation_size(C.oid)) AS "size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
and nspname = 'public'
and relkind = 'r'
ORDER BY pg_relation_size(C.oid) DESC;
@KhodeN
KhodeN / batch_paraller.go
Created March 20, 2018 07:50
batch_paraller.go
package main
import (
"fmt"
"time"
)
func main() {
input := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
@KhodeN
KhodeN / stdin_read.go
Last active February 25, 2018 12:02
Задачка из курса. Заготовка. Читает из stin, пишет в stdout
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { Inject, Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { API_URL } from 'st/constants';
@Injectable()
export class ApiUrlInterceptor implements HttpInterceptor {
constructor(@Inject(API_URL) private _apiUrl: string) {