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 / 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'
function scrollTo(Y, duration, easingFunction, callback) {
var start = Date.now(),
elem = document.documentElement.scrollTop?document.documentElement:document.body,
from = elem.scrollTop;
if(from === Y) {
callback();
return; /* Prevent scrolling to the Y point if already there */
}
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8' />
<link rel='stylesheet' href='style.css' />
</head>
<body>
<form id="myform">
<input type="text" name="login" id="login" />