Skip to content

Instantly share code, notes, and snippets.

View agrublev's full-sized avatar
💭
Always moving forward

Angel Grablev agrublev

💭
Always moving forward
View GitHub Profile
@agrublev
agrublev / adapter.md
Created October 3, 2018 09:53
Snippets math

Quokka #2 (node: v8.11.3)

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.prototype.slice(0,n) and the spread operator (...).

Code

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
@agrublev
agrublev / array.md
Last active October 3, 2018 09:48
Array Code Snippets

Returns true if the provided predicate function returns true for all elements in a collection, false otherwise.

Use Array.prototype.every() to test if all elements in the collection return true based on fn. Omit the second argument, fn, to use Boolean as a default.

Code

const all = (arr, fn = Boolean) => arr.every(fn);
@agrublev
agrublev / macsetup.sh
Created September 25, 2018 03:38
SET
#!/usr/bin/env bash
# TODO INSTALL MAGET APP
#https://gist.github.com/jexchan/5754956
#https://github.com/mathiasbynens/dotfiles/blob/master/.macos
#https://jonlabelle.com/snippets/view/shell/mac-os-x-defaults
# ~/.macos — https://mths.be/macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
@agrublev
agrublev / fix_yarn_bug.md
Created August 16, 2018 17:37
YARN BUG error An unexpected error occurred: "/package.json: Unexpected number in JSON at position 1".

##To fix the stupid but that yarn has that if you have a file called /package.json in the root of your system yarn will fail!

###all you need to do is

sudo rm /package.json
@agrublev
agrublev / dronefly.js
Last active June 24, 2018 23:12 — forked from bearoff/dronefly.js
drone FORK!
const pdrone = require('pdrone');
const drone = pdrone({id: 'mambo', debug: false});
/** Helper function */
function sleep(ms) {
return new Promise(a => setTimeout(a, ms));
}
// DIRECTIONS
// - up / down / left / right /forward /back
const camelcase = require('camelcase');
const { DroneConnection, CommandParser } = require('pdrone-low-level');
const EventEmitter = require('events');
const formatArguments = args =>
args.reduce(
(acc, cur) => ({
...acc,
[cur._name]: cur._value,
}),
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2017 Parrot SA
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2017 Parrot SA
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
@agrublev
agrublev / dronefly.js
Last active June 24, 2018 20:52
drone FORK!
const pdrone = require('pdrone');
const drone = pdrone({id: 'mambo', debug: false});
/** Helper function */
function sleep(ms) {
return new Promise(a => setTimeout(a, ms));
}
drone.on('connected', async () => {
// drone.flatTrim(); // use flatTrim() everytime you want the drone to calm down

Year of manufacture: 2017 Version: 10.12.6 (16G29) Developer: Apple Inc. Developer's site: © Apple Inc. Platform: Intel with support for SSE4.2 (it is possible to run on the CPU with SSE4.1), for AMD there is an instruction for FX-series Language: multilanguage Tablet: VMware Unlocker for all versions of VMware ---- version of VMware 10 and below or version of VMware 11 and aboveSystem requirements:

  1. Intel processor with support for hardware virtualization
  2. From 1 GB of RAM (2 GB or more is recommended)
  3. The program WinRar, 7-Zip or analog