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 / genFileDateName.js
Last active October 22, 2019 19:56
Generate filename with date
/**
* Return a timestamp with the format "m-d-yy"
* @type {Date}
*/
function timeStamp() {
// Create a date object with the current time
let now = new Date();
// Create an array with the current month, day and time
const arr1 = [1, 2, 3, 4, 5];
if (arr1.indexOf(1) !== -1) {
console.log("Arr1 HAS the integer 1!");
}
if (arr1.includes(1)) {
console.log("Arr1 HAS the integer 1!");
}
@agrublev
agrublev / cleanall.sh
Created June 4, 2019 05:49
Clean all node modules
find . -name "node_modules" -exec rm -rf '{}' +
@agrublev
agrublev / RECURS_OBJECTS.js
Last active April 23, 2019 19:13
Recursive object manipulation
const iterateObject = (obj, executeOnValue) => {
Object.keys(obj).forEach(name=> {
let val = obj[name];
if (typeof val === "object") {
return iterateObject(val, executeOnValue);
} else if (val === undefined) {
obj[name] = "";
} else {
obj[name] = executeOnValue(val);
}
import "@blueprintjs/icons/lib/css/blueprint-icons.css";
import "@blueprintjs/core/lib/css/blueprint.css";
module.exports = {
plugins: ["react","markdown"],
globals: {
importScripts: true
},
env: {
browser: true,
node: true,
es6: true
},

The simplest way to run your npm type tasks

You write a beautiful & documented Markdown file, we run it for you. And you have a lot of flexibility!

Example FcScripts.md file

Or if you want to ensure that your teammates are using the same version as you, it's recommended to install Maid locally:

# For npm users
npm i -D maid
@agrublev
agrublev / CodeStoryPhpStorm.md
Last active March 3, 2019 21:42
How to add PhpStorm or WebStorm to Code Story

Getting PhpStorm to auto open file/line with Code Story

Steps

  1. Go to PhpStorm/WebStorm and under Tools get the path to cmd launcher Get the path of app
  2. It will look like this /usr/local/bin/pstorm Path
  3. Now go to Code Story and in the menu click Preferences
@agrublev
agrublev / index.js
Created January 25, 2019 00:06 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
console.log('yay gist')