Skip to content

Instantly share code, notes, and snippets.

View ilyaashapatov's full-sized avatar
🏠
Working from Sber

Ilya Ashapatov ilyaashapatov

🏠
Working from Sber
View GitHub Profile
@ilyaashapatov
ilyaashapatov / WKWebViewExtension.swift
Created November 14, 2018 14:52 — forked from mrcgrtz/WKWebViewExtension.swift
Swift 3 Extension for opening target="_blank" and mailto:/tel: links in native iOS apps
import UIKit
import WebKit
class ViewController: UIViewController {
var webView: WKWebView = WKWebView() {
didSet {
webView.navigationDelegate = self
webView.uiDelegate = self
}
@ilyaashapatov
ilyaashapatov / user.js
Created April 1, 2018 16:24 — forked from EtienneR/user.js
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);
@ilyaashapatov
ilyaashapatov / _helpers.scss
Created September 25, 2017 21:47
Hexagon (+ shadow) sass mixin
////////////////////////////////////////
// Plain SASS Trigonometry Algorithm //
////////////////////////////////////////
$pi: 3.14159265359;
$_precision: 10;
@function pow($base, $exp) {
$value: $base;
@if $exp > 1 {
@ilyaashapatov
ilyaashapatov / cropped.js
Last active September 13, 2017 12:02
Elements crop
$(function () {
var container = $('.js-users-crop');
if (container.length === 0) return;
var config = {
rowsCrop: (!container.attr('data-row')) ? 2 : +container.attr('data-row'), // Получаем сколько хотим видеть рядов или 2
widthChildren: container.children().outerWidth(true),
heightChildren: container.children().outerHeight(true),
openText: 'Показать всех',
function xhr($url, $type, $data) {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
@ilyaashapatov
ilyaashapatov / gallery.bxslider.html
Created April 22, 2016 14:09 — forked from craigmdennis/gallery.bxslider.html
A BX Slider configuration that uses 2 separate sliders. One for the gallery and one for the thumbs.
alias g='git'
alias gst='git status'
alias gc='git commit -a -m'
alias gco='git checkout'
alias gcm='git checkout master'
alias gb='git branch'
alias glg='git log --stat --max-count=5'
alias ga='git add .'
alias gsh='git stash'
@ilyaashapatov
ilyaashapatov / slick.styl
Last active July 6, 2016 08:16
slick slider, stylus
$slick-font-path ?= "../fonts/"
$slick-font-family ?= "slick"
$slick-loader-path ?= "../images/"
$slick-arrow-color ?= white
$slick-dot-color ?= black
$slick-dot-color-active ?= $slick-dot-color
$slick-prev-character ?= '\2190'
$slick-next-character ?= '\2192'
$slick-dot-character ?= '\2022'
$slick-dot-size ?= 6px
@ilyaashapatov
ilyaashapatov / Preferences.sublime-settings
Last active November 17, 2018 07:17
my sub settings
{
"auto_complete_selector": "source, text",
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"detect_slow_plugins": false,
"drag_text": true,
"draw_white_space": "all",
"font_face": "Monaco",
"font_size": 12.0,
"hayaku_CSS_prefixes_disable": true,