Skip to content

Instantly share code, notes, and snippets.

View freewayspb's full-sized avatar
🚀
Focusing

Aleksei Chyrva freewayspb

🚀
Focusing
View GitHub Profile
@freewayspb
freewayspb / style.css
Last active February 3, 2021 10:30
css detect device, custom styles for touch and non touch devices example
/* smartphones, touchscreens */
@media (hover: none) and (pointer: coarse) {
/* ... */
}
/* stylus-based screens */
@media (hover: none) and (pointer: fine) {
/* ... */
}
/* Nintendo Wii controller, Microsoft Kinect */
@media (hover: hover) and (pointer: coarse) {
@freewayspb
freewayspb / isoNameToFlagEmoji.js
Created August 8, 2020 20:22
Method for convertation ISO country name to flag emoji
// ISO 3166-1 alpha-2
// ⚠️ No support for IE 11
const countryToFlag = isoCode => {
return typeof String.fromCodePoint !== 'undefined'
? isoCode.toUpperCase().replace(/./g, char => String.fromCodePoint(char.charCodeAt(0) + 127397))
: isoCode
}
export default countryToFlag
@freewayspb
freewayspb / README.md
Created September 21, 2019 12:45 — forked from knoopx/README.md
Creality Ender 3 Stock Factory Vref

Creality3D v1.1.2 stock vref values

A4988 Drivers
Vref set to ~90% of stepper rated current
Rs = 0.1ohm

X = 0,58v (0,725A)
Y = 0,58v (0,725A)
Z = 0,58v (0,725A)
@freewayspb
freewayspb / credit-card-regex.md
Created September 17, 2018 14:08 — forked from michaelkeevildown/credit-card-regex.md
Credit Card Regex Patterns

Credit Card Regex

  • Amex Card: ^3[47][0-9]{13}$
  • BCGlobal: ^(6541|6556)[0-9]{12}$
  • Carte Blanche Card: ^389[0-9]{11}$
  • Diners Club Card: ^3(?:0[0-5]|[68][0-9])[0-9]{11}$
  • Discover Card: ^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$
  • Insta Payment Card: ^63[7-9][0-9]{13}$
  • JCB Card: ^(?:2131|1800|35\d{3})\d{11}$
  • KoreanLocalCard: ^9[0-9]{15}$
@freewayspb
freewayspb / how-to-setup-mac-elasticsearch.md
Created October 6, 2017 10:12 — forked from jpalala/how-to-setup-mac-elasticsearch.md
setting up elasticsearch on your mac with brew

Install va homebrew

If you don't have homebrew installed - get homebrew here

Then run: brew install elasticsearch

Configuration

Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml.

export default class ApiService {
/*@ngInject*/
constructor() {
this.protocol = 'https://';
/* dev api config */
this.izBilling = this.protocol + '101cloudlicenses.azurewebsites.net';
this.izInvoices = this.protocol + '101cloudbilling.azurewebsites.net';
['https://cms.cian.ru/admin/content/articles/217979/change', 'https://cms.cian.ru/admin/content/articles/218104/change', 'https://cms.cian.ru/admin/content/articles/218208/change', 'https://cms.cian.ru/admin/content/articles/217463/change', 'https://cms.cian.ru/admin/content/articles/217980/change', 'https://cms.cian.ru/admin/content/articles/218370/change', 'https://cms.cian.ru/admin/content/articles/218105/change', 'https://cms.cian.ru/admin/content/articles/217982/change', 'https://cms.cian.ru/admin/content/articles/218106/change', 'https://cms.cian.ru/admin/content/articles/218107/change', 'https://cms.cian.ru/admin/content/articles/217358/change', 'https://cms.cian.ru/admin/content/articles/218108/change', 'https://cms.cian.ru/admin/content/articles/217983/change', 'https://cms.cian.ru/admin/content/articles/218371/change', 'https://cms.cian.ru/admin/content/articles/218209/change', 'https://cms.cian.ru/admin/content/articles/217984/change', 'https://cms.cian.ru/admin/content/articles/218109/change', 'ht
@freewayspb
freewayspb / email regexp
Created July 19, 2017 13:51
Universal email regexp java-script
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
@freewayspb
freewayspb / app.html
Created March 29, 2017 06:20
angular number filter
<div class="container" ng-app="myApp" ng-controller="Main">
<h3>Angular Format Number</h3>
<ul class="list-unstyled">
<li>
<span class="label label-success">{{ 12345 | nearestK}}</span>
</li>
<li>
<span class="label label-success">{{ 145 | nearestK}}</span>
</li>
<li>
@freewayspb
freewayspb / web.config
Created December 22, 2016 06:03
azure config for angularjs app with static json files
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<system.web>
<httpRuntime maxUrlLength="2000" relaxedUrlToFileSystemMapping="true" />
</system.web>