Skip to content

Instantly share code, notes, and snippets.

@gbarkhatov
gbarkhatov / instapaper_bulk_delete_userscript.js
Created November 16, 2024 14:04 — forked from seanlaidlaw/instapaper_bulk_delete_userscript.js
adds a "Bulk delete" button to instapaper to delete all 40 articles on current page. Requires confirmation before deleting.
// ==UserScript==
// @name Instapaper Bulk Delete
// @namespace https://www.instapaper.com/u
// @version 0.1
// @description Provides an option to bulk delete all articles on current page of instapaper
// @author Sean Laidlaw
// @match https://www.instapaper.com/u
// @grant none
// ==/UserScript==
@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)