Skip to content

Instantly share code, notes, and snippets.

@ncer
ncer / debounce-es2015.js
Created February 17, 2021 11:24 — forked from vincentorback/debounce-es2015.js
Smarter debouncing
export function debounce (fn, wait = 1) {
let timeout
return function (...args) {
clearTimeout(timeout)
timeout = setTimeout(() => fn.call(this, ...args), wait)
}
}
@ncer
ncer / gitflow-breakdown.md
Created March 20, 2019 13:52 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@ncer
ncer / long-shadow.styl
Created August 10, 2018 08:56 — forked from tancredi/long-shadow.styl
Long shadow Stylus mixin
// Stylus version of SCSS mixin from http://codepen.io/awesomephant/pen/mAxHz
long-shadow(type = 'box', base-color = rgba(#000, .2), length = 100, fadeout = true, skew = false, direction = 'right')
shadow = ''
if !skew || type == 'text'
if direction == 'right'
for i in (0..length - 1)
shadow = shadow + i + 'px ' + i + 'px 0 ' + base-color + ','
@ncer
ncer / fileUpload.vue
Created July 24, 2018 07:38 — forked from raisiqueira/fileUpload.vue
Simple file upload with Vue and Axios
<style>
input[type="file"]{
position: absolute;
top: -500px;
}
div.file-listing{
width: 200px;
}
@ncer
ncer / isIE.js
Created March 28, 2018 07:03 — forked from gaboratorium/isIE.js
Detect IE with JavaScript #ie #edge #js #javascript
// Forked from https://codepen.io/gapcode/pen/vEJNZN
// Get IE or Edge browser version
var version = detectIE();
if (version === false) {
document.getElementById('result').innerHTML = '<s>IE/Edge</s>';
} else if (version >= 12) {
document.getElementById('result').innerHTML = 'Edge ' + version;
} else {
@ncer
ncer / font-mixins.less
Last active December 18, 2017 03:12
Font Mixins / Миксины для разных шрифтовых начертаний
// Font variables
@reserveFonts: sans-serif;
@fontPrimary: 'Roboto Condensed', @reserveFonts;
// Font mixins
.font-primary() {
font-family: @fontPrimary;
font-weight: normal;
@ncer
ncer / device.css
Created November 8, 2017 11:27 — forked from jsoverson/device.css
Quick css hacks to target android/ios
.visible-android {
display:none;
}
.visible-ios {
display:none;
}
.on-device .visible-android, .on-device .visible-android {
display:inherit;
}
.device-ios .visible-android {
@ncer
ncer / for.php
Last active June 2, 2018 13:38
PHP helpers
<? for ($i = 1; $i <= 5; $i++) {?>
<p><?= $i ?></p>
<?}?>
@ncer
ncer / browserconfig.xml
Created February 27, 2017 07:15
HTML5 Boilerplate
<?xml version="1.0" encoding="utf-8"?>
<!-- Please read: https://msdn.microsoft.com/en-us/library/ie/dn455106.aspx -->
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="tile.png"/>
<square150x150logo src="tile.png"/>
<wide310x150logo src="tile-wide.png"/>
<square310x310logo src="tile.png"/>
</tile>