Skip to content

Instantly share code, notes, and snippets.

View simple17's full-sized avatar

Alexander Khripko simple17

  • FirstLine software
  • Montenegro
View GitHub Profile
@simple17
simple17 / _select.scss
Last active April 9, 2020 10:47
[Styled select] #scss
select {
height: 54px;
padding: 14px 13px;
border: solid 1px $input-border-color;
background-color: $input-background-color;
@simple17
simple17 / _checkbox.scss
Last active April 9, 2020 12:03
[Styled checkbox] #scss
.styled-checkbox {
input[type="checkbox"] {
display: none;
visibility: hidden;
opacity: 0;
}
&__label-content {
@simple17
simple17 / block.scss
Created April 6, 2020 16:33
[SCSS BEM mofifiers] #BEM #SASS #SCSS
.block {
display: block;
&__element {
display: inline;
&--m1 {
background-color: red;
}
@simple17
simple17 / ytApiHelper.js
Created April 3, 2020 10:52
[YouTube API Helper] #youtube #helper
(() => {
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
const createPlayer = (container, videoId, onReady = () => {}, onStateChange = () => {}) => {
return new YT.Player(container, {
@simple17
simple17 / checkVarPromise.js
Created March 30, 2020 09:45
[Check Variable Promise]
const checkActiveModals = function() {
return new Promise(function (resolve, reject) {
(function waitForModals(){
if (!isAnySuggestModalShown) return resolve();
setTimeout(waitForModals, 500);
})();
});
}
@simple17
simple17 / vimeo.js
Created February 20, 2020 12:20
[Vimeo Thumbs] #vimeo
function vimeoLoadingThumb(id) {
var url = "http://vimeo.com/api/v2/video/" + id + ".json?callback=showVimeoThumb";
var id_img = "#vimeo-" + id;
var script = document.createElement('script');
script.src = url;
$(id_img).before(script);
}
@simple17
simple17 / bem.scss
Created January 29, 2020 10:00
[BEM SCSS] #scss #BEM
$carousel-class: '.carousel';
#{$carousel-class}--recommended-products {
width: 100%;
#{$carousel-class}__item {
width: calc(100% - 80px);
.container {
background-color: rgba($neogen-light-gray, 0.15);
@simple17
simple17 / web.config
Created January 21, 2020 08:49
[Fiddler Epi Web.Config] #episerver #fiddler
<system.net>
<defaultProxy
enabled = "true"
useDefaultCredentials = "true">
<proxy
autoDetect="false"
bypassonlocal="false"
proxyaddress="http://127.0.0.1:8888"
usesystemdefault="false"
/>
@simple17
simple17 / rename.cs
Created January 10, 2020 08:56
[rename cart] #episerver #commerce
public bool RenameListForAccount(Guid accountId, string oldName, string newName)
{
var cart = _orderRepository.Load<ICart>(accountId, oldName).FirstOrDefault();
if (_orderRepository.Load<ICart>(accountId, newName).Any() || (cart is null))
{
Log.Error($"Cannot rename list for account {accountId} with name {newName} because a cart with this name already exists for this account");
return false;
}
@simple17
simple17 / reset-site.txt
Created January 9, 2020 09:00
[Reset site cahche] #chrome
chrome://settings/siteData