Skip to content

Instantly share code, notes, and snippets.

const c = console.log
//All for One
function unary(fn) { //przekazuje dalej tylko jeden agrument
return function onlyOneArg(arg){
return fn( arg );
};
}
const c = console.log
function partialRight(fn,...presetArgs) {
return function partiallyApplied(...laterArgs){
return fn( ...laterArgs, ...presetArgs );
};
}
function reverseArgs(fn) {
return function argsReversed(...args){
return fn( ...args.reverse() );
};
c = console.log
//Mathematical Idempotence
function toPower0(x) {
return Math.pow( x, 0 );
}
function snapUp3(x) {
return x - (x % 3) + (x % 3 > 0 && 3);
}
c = console.log
//Primitive Immutability
// invalid, and also makes no sense
//2 = 2.5;
var x = 2;
x.length = 4;
ctrl + i -> implement required methods
ctrl + o -> override methods
ctrl + p -> show required arguments
ctrl + w -> select
ctrl + e -> recent files
ctrl + space -> suggestions
ctrl + b -> view implementation
ctrl + n -> find class --
ctrl + h -> show hierarchy
ctrl + alt + l -> auto format code
from abc import ABC, abstractmethod
from PIL import Image, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
from functools import reduce
from datetime import datetime
import shutil
import os
class ImageRecovery:
def __init__(self, pathToRecoveryDirectory, pathToNewImagesDirectory, imageFilters):
const FtpDeploy = require("ftp-deploy")
const ftp = require("basic-ftp")
const basicFtpClient = new ftp.Client()
const https = require('https');
const LOCAL_BUILD_DIRECTORY = "public"
const DEPLOY_DIRECTORY_NAME = "temp"
const PRODUCTION_DIRECTORY_NAME = "master"
const BROKEN_BUILD = "broken"
const PRODUCTION_URL = "https://akjaw.com/"