Skip to content

Instantly share code, notes, and snippets.

@hayk94
hayk94 / webstorm.cmd
Created January 27, 2020 12:07
Add "Open with Webstorm", "Open with IDEA" to windows context menu when using Toolbox
@echo off
:: change the path below to match your installed version
SET IDEApath=C:\Users\User\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\193.6015.39\bin\idea64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\IDEA" /t REG_SZ /v "" /d "Open with IDEA" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\IDEA" /t REG_EXPAND_SZ /v "Icon" /d "%IDEApath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\IDEA\command" /t REG_SZ /v "" /d "%IDEApath% \"%%1\"" /f
@hayk94
hayk94 / chunkArrayByElement.js
Created September 29, 2017 05:53
Chunk array by element or split array like a string
/**
* chunkArrayByElement - Chunk array by element or split array like a string
*
* @param {Array} arr array to chunk
* @param {Any} c element to chunk by
* @return {Array} array containing chunk arrays
*/
// https://stackoverflow.com/questions/46468754/chunk-array-by-element
function chunk(arr, el) {
if (arr.length === 0) {
@hayk94
hayk94 / countElemInArray.js
Created September 29, 2017 05:39
Count Elements in the array
function countElemInArray (array, elemToCount) {
return array.filter(elem => elem === elemToCount).length
}
AtomSync
@hayk94
hayk94 / UploadFile.jsx
Created February 23, 2017 06:45
Upload file to dropbox with Meteor 1.4 FEB 2017 Simple way
// Will make this file simpler in the future, however for now...
// Get the file with HTML 5 or React Dropzone
uploadCallback (file) {
console.log('file', file)
this.getBase64(file, this)
}
getBase64 (file, self) {
const reader = new FileReader()