Skip to content

Instantly share code, notes, and snippets.

@gbarkhatov
gbarkhatov / AdvancedWindowSnap.ahk
Created August 7, 2018 04:50 — forked from Cerothen/AdvancedWindowSnap.ahk
Advanced Window Snap is a script for AutoHotKey that expands upon Windows built-in window-snapping hotkeys.
/**
* Advanced Window Snap (Extended
* Snaps the Active Window to one of nine different window positions.
*
* @Editing author Jarrett Urech
* @Original author Andrew Moore <andrew+github@awmoore.com>
* @version 2.1
*
**/
@gbarkhatov
gbarkhatov / async-await.js
Created March 19, 2018 06:51 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@gbarkhatov
gbarkhatov / axios-catch-error.js
Created December 19, 2017 12:27 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
axios.put(this.apiBaseEndpoint + '/' + id, input)
.then((response) => {
// Success
})
.catch((error) => {
// Error
if (error.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
// console.log(error.response.data);

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)