Skip to content

Instantly share code, notes, and snippets.

View makstheimba's full-sized avatar

Maksim Kulichenko makstheimba

  • Tripleten
  • Belgrade
View GitHub Profile
@PartTimeLegend
PartTimeLegend / vboxdrvfix.md
Last active September 24, 2019 01:44
/etc/init.d/vboxdrv setup Not Found - VirtualBox Fix!

#/etc/init.d/vboxdrv setup Not Found - VirtualBox Fix!

When setting up Virtual Box I was faced with the immortal error telling me to run sudo /etc/init.d/vboxdrv setup. Simple enough, until you're told it doesn't exist.

Thus began my fight to get it working. The fix is here in the hope that it helps someone else.

To follow this guide you need to have a basic understanding of shell commands. If you don't, then just be careful.

First off I like aptitute so let's install it.

@andersfly
andersfly / detectDragModifierKeys.js
Created March 4, 2016 09:22
Detect modifier keys from underlying (or global) drag events
import pick from 'lodash/pick';
import bindAll from 'lodash/bindAll';
import React from 'react';
import ReactDOM from 'react-dom';
const MODIFIER_KEYS = ['ctrlKey', 'shiftKey', 'altKey', 'metaKey'];
/**
* Detects drag modifier keys on drag events that originated
* from the wrapped component
@jesperorb
jesperorb / cors.md
Last active February 21, 2024 14:17
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin