Skip to content

Instantly share code, notes, and snippets.

View worst-developer's full-sized avatar
🇺🇦
doing magic 🌈

Yaroslav Pidmohylniy worst-developer

🇺🇦
doing magic 🌈
  • Tictrac
  • Lviv, Ukraine
  • 08:18 (UTC +03:00)
View GitHub Profile
const { exec } = require('child_process')
const { promisify } = require('util')
const chalk = require('chalk')
// See: https://docs.npmjs.com/about-audit-reports#severity
const SEVERITY_LEVELS = ['low', 'moderate', 'high', 'critical']
const SEVERITY_THRESHOLD = 'critical'
const run = promisify(exec)
// Get the output of a command. If the command exits with a non-zero code, try
@worst-developer
worst-developer / checkbox.jsx
Created November 23, 2017 16:10
React-recompose checkbox
import React from 'react';
import { compose, withState, withHandlers } from 'recompose';
const Checkbox = ({ isChecked, handleClick }) => (
<input
type="checkbox"
checked={isChecked}
onClick={handleClick}
/>
);
import Logger from "../Logger/Logger";
import * as FormData from "form-data";
class RequestNormalizer {
private policyTransformer: string = "json";
public convertToFormData(data) {
if (data.hasOwnProperty("attachment") === true) {
const formData = new FormData();
const Promise = require('bluebird');
const ObjectId = require('sails-mongo/node_modules/mongodb').ObjectID;
/**
* Advertises a video.
* Creates adset, adcreatives, ads and links it to existing compaign and account
*
* @param {string} postMessage in the ad post
* @param {object} place {lat, lng, radius}
* @param {object} time {startTime, endTime} like 2015-12-16 22:59:59 UTC or Unix time
const app_root = 'src'; // the app root folder: src, src_users, etc
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const fontLoader = require('font-awesome-sass-loader');
module.exports = {
app_root: app_root,
entry: [
const app_root = 'src'; // the app root folder: src, src_users, etc
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
app_root: app_root,
entry: [
'webpack-dev-server/client?http://localhost:3005',
export function signUp (data) {
return async dispatch => {
debugger;
const response = await httpPost('/auth/signup', data);
if (response.status !== 200) {
debugger;
dispatch({
type: Constants.REGISTRATIONS_ERROR,
export function checkToken () {
return async dispatch => {
const response = await httpGet(`/auth/validate-access-token/${localStorage.getItem('AuthToken')}`);
if (response.status !== 200) {
localStorage.removeItem('AuthToken');
dispatch({
type: Constants.TOKEN_ERROR,
//*******************scss***********************
%button {
border-radius: 4px;
border: 4px solid black;
}
@mixin button($name, $background-color) {
.#{$name}-button {
background-color: $background-color;
@extend %button;
//***********scss***************
// Создаем mixin
@mixin respond-to($media) {
@if $media == handhelds {
@media only screen and (max-width: 479px) { @content; }
}
@else if $media == wide-handhelds {
@media only screen and (min-width: 480px) and (max-width: 767px) { @content; }
}
@else if $media == tablets {