Skip to content

Instantly share code, notes, and snippets.

it("Menu scrolls if the hovered option is out of the viewport", () => {
const extraOptions = [
{ label: "value D4", value: "D4" },
{ label: "value E5", value: "E5" },
{ label: "value F6", value: "F6" },
];
const updatedOptions = options.concat(extraOptions);
console.log('--- extra', updatedOptions);
headers = new Headers();
headers.set('Content-Type', 'application/json');
headers.set('Authorization', `JWT ${localStorage.token}`);
options = {
method: 'GET',
headers: headers,
};
res = await fetch(`/cors-proxy/api/v1/users/1/`, options);
async componentDidMount(){
this.setState({isLoading: true});
const users = (await api.getAdminDashboardUsers()).data;
const rows = this.convertUsersToGridRows(users);
// Variable is out of component scope
allPlatformCompanies = (await api.getAllPlatformCompanies()).data;
await this.setState({
@egorvinogradov
egorvinogradov / vervoe-mass-invite.js
Last active January 25, 2018 23:09
Vervoe.com mass invite via CSV upload is not working. This code pushes invitees to Vervoe directly through their REST API
function makeRequestBody(rows, jobSlug){
var paramArr = [];
for (var i = 0; i < rows.length; i++) {
var name = rows[i].name.replace(/\s+/g, '+');
var email = encodeURIComponent(rows[i].email);
var nameS = `%22invitation_name${i + 1}%22%3A%22${name}%22`;
var emailS = `%22invitation_email${i + 1}%22%3A%22${email}%22`;
paramArr.push(`${nameS}%2C${emailS}`);
}
@egorvinogradov
egorvinogradov / CNAME
Created December 3, 2017 08:25
text-editor
majestic-geese.surge.sh
const capitalizationMark = '000001';
const space = '000000';
function decodeString(word, binaryEncoded){
var dict = {};
word.split('').forEach(function(letter){
if (/[A-Z]/.test(letter)) {
binaryEncoded = binaryEncoded.replace(/^000001/, '');
[
{
"category": "Web Development",
"keywords": [
["Chief Technology Officer"],
["CTO"],
["R&D"],
["Architect"],
["Database", "Administrator"],
["Information", "Technology"],
{
"_total": 1,
"values": [
{
"_key": "~",
"connections": {
"_total": 26
},
"currentStatus": "is playing with the LinkedIn Ruby gem",
"emailAddress": "ovzaits@gmail.com",
* {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.content {
margin-top: 50px;
}
.user-photo {
padding-top: 20px;
@egorvinogradov
egorvinogradov / ffmpeg-cut-concatenate.js
Last active May 18, 2017 02:04
Generate bash commands to cut and concatenate a video based on time periods (using ffmpeg)
/*
1. Open http://majestic-geese.surge.sh
2. Insert time periods e.g.:
5:49 - 7:24
10:11 - 11:22
11:58- 12:45
13:04- 13:34
13:48 - 13:58
17:08- 18:08