Skip to content

Instantly share code, notes, and snippets.

View superKalo's full-sized avatar

Kaloyan Kosev superKalo

View GitHub Profile
@superKalo
superKalo / working-with-remote-data-architecture.md
Last active September 18, 2017 18:05
Useful Abstractions When Working With Remote Data in JavaScript

Define an API Abstraction

Define an API module, that does the actual AJAX requests:

const API = {
    /** Simple service for generating different HTTP codes. */
    url: 'http://httpstat.us/',

    /**
@superKalo
superKalo / browser-extension-api.js
Last active October 17, 2017 09:54
Make your browser extension code compatible with all browsers APIs
/**
* Тhe Extension API model is currently being standardized to browser.xxx,
* and some browsers are defining their own namespaces in the meantime
* (for example, Edge is using msBrowser).
*
* Fortunately, most of the API remains the same behind the browser.
* So, it’s very simple to support all browsers and namespace definitions.
*
* You’ll also need to use the subset of the API supported by all browsers:
* - Microsoft Edge: https://docs.microsoft.com/en-us/microsoft-edge/extensions/api-support
@superKalo
superKalo / my-development-focus.md
Last active March 5, 2019 09:12
Open-source-ing my development goals!

I decided to open-source my development goals for the upcoming year(s). Here are my reasons why:

  1. Accountability. When I bring other people in my goal picture - my overall involvement is considerably higher
  2. Clarity. When I tell the world about some of my goals - I modify them. I take something from a discussion, something from another one, until my goal emerges in a new form - a much clearer one.
  3. Progress Measurement. Sharing my goals makes the progress measurement easier. Sometimes I use my friends as guides or supervisors. This helps me achieve more.
  4. Motivation. When I tell people about my goal something interesting happens. The mere facts that I tell to somebody else, acts like an incentive to me. It's not about accountability, but about being pumped up and ready to act. > 5. Connection. Sharing my goals with like-minded people helps me grow my social circle. Goals aside, the mere fact that you take the time to share something, to give details, to bring upd
@superKalo
superKalo / deploy.php
Last active December 14, 2016 14:40
Git Deployment Script. Attention, that's not really a best practice :)
<?php
/**
* GIT DEPLOYMENT SCRIPT
*
* Used for automatically deploying websites via github or bitbucket, more deets here:
*
* https://gist.github.com/1809044
*/
// The commands
@superKalo
superKalo / Sortable.jsx
Last active August 9, 2022 09:31
How to use jQuery UI with React JS? You can use this approach to integrate almost any jQuery plugin! Full details and explanation here: http://stackoverflow.com/a/40350880/1333836
class Sortable extends React.Component {
componentDidMount() {
// Every React component has a function that exposes the
// underlying DOM node that it is wrapping. We can use that
// DOM node, pass it to jQuery and initialize the plugin.
// You'll find that many jQuery plugins follow this same pattern
// and you'll be able to pass the component DOM node to jQuery
// and call the plugin function.