Skip to content

Instantly share code, notes, and snippets.

View kepek's full-sized avatar
💭
I may be slow to respond.

Michal Kechner kepek

💭
I may be slow to respond.
View GitHub Profile
@kepek
kepek / Install_USB_Maker.sh
Created August 10, 2023 13:02 — forked from dakanji/Install_USB_Maker.sh
Creates Bootable USB for Mac OS Lion to Monterey (Excluding Mavericks)
#!/usr/bin/env bash
# Install_USB_Maker.sh
# Copyright (c) 2020 - 2023 Dayo Akanji
# - [email protected]
# Portions Copyright (c) Jeff Geerling
# - https://github.com/geerlingguy/macos-virtualbox-vm/blob/master/LICENSE
#
# MIT License
@kepek
kepek / strapi-plugin-documentation-extend-middleware.ts
Last active May 11, 2023 21:33
@strapi/plugin-documentation middleware which expose openapi.yaml & swagger.json. Tested with 4.x
/**
* `documentation` middleware
*/
import { Strapi } from '@strapi/strapi';
import * as fs from 'fs';
import * as path from 'path';
import yaml from 'js-yaml';
function getDocumentationService(ctx, strapi: Strapi) {
curl 'http://skf.dev.workplace.nu/api/cart/' -X PUT -H 'Origin: http://skf.dev.workplace.nu' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' -H 'Content-type: application/json' -H 'Accept: */*' -H 'Referer: http://skf.dev.workplace.nu/widget/' -H 'Cookie: ASP.NET_SessionId=4hkig0yxhtjy2i4rcujianbq; LitiumShoppingCart=59c3f3ab-b6e2-4e83-963f-2b41aab11dde; .AspNet.Litium=fv63iPFml40AYDVNJpYcmZYIvkFvIK46JapT6UF1SDPSA7rXKorutb-wPHPgPaKJRKJ_2ZZgSWZhMZmg6bnbD57-siZ07_x1O7HsBgdidrGC63-14Si_Scif-5IOu1GFpqI9qFLnXFIrM0-CFgsYa2qHQb9voIiMUxkepIHZoGe_pYC0L5mk-jx5V30wADg2u9kRVhNJqckArqSkrnuGlAugfBuCmjQ2YZQw-ow-pnv9ukMm8T6-aq4dAgyTDSE3PtxpQWJbh85jtgNSgPlgaWL8VrlVeV4pzBRiu-VOu7ZMEOTvimfkOCxIIz2LVFaihvMCE0FF_rGKRs9U9SMB5nLNkjGmSrlq51cg0QHYIlxph9dHjm_bNf_NZDmvVZKE3u31xSF6qmdob9jxvELVQX1wdhlsJUcUOQR0JCYiX0TCWJZ9aeCfjUTyqcDE4CfIY7A5v8gUzp5cDtAjB2a-QQ; _ga=GA1.2.1325390646.15
export interface IStringTMap<T> {
[key: string]: T;
}
export class COptions<TProperties> {
constructor(properties?: TProperties) {
if (properties) {
for (let propertyName in properties) {
if (properties.hasOwnProperty(propertyName)) {
Object.defineProperty(this, propertyName, {
export default class CComponent<
TElements extends Element,
TOptions extends Object
> {
private elements: TElements | NodeListOf<TElements> | null;
private options: TOptions;
constructor(
elements: TElements | NodeListOf<TElements> | null,
options?: TOptions
@kepek
kepek / COptions.ts
Last active September 5, 2018 06:19
export interface IStringTMap<T> {
[key: string]: T;
}
export class COptions<TProperties> {
constructor(properties?: TProperties) {
if (properties) {
for (let propertyName in properties) {
if (properties.hasOwnProperty(propertyName)) {
Object.defineProperty(this, propertyName, {
@kepek
kepek / checkDigit_UPC-A.js
Last active July 3, 2018 14:01
Generate check digit for UPC-A
function checkDigit(value) {
value = value.toString();
var checkDigit = 0,
evens = 0,
odds = 0,
checkDigit = 0;
for (var i = 0; i < value.length; i++) {
// For zero-based arrays, odd digits are even indexes
const sequence = (tasks, fn) => tasks.reduce((promise, task) => promise.then(() => fn(task)), Promise.resolve())
@kepek
kepek / ApacheHTTPSConfig.md
Last active May 23, 2017 14:28 — forked from nrollr/ApacheHTTPSConfig.md
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with macOS Sierra (10.12.5) running Apache/2.4.25
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /usr/local/etc/apache2/2.4/ using Terminal.app: sudo mkdir /usr/local/etc/apache2/2.4/ssl
Next, generate two host keys:

@kepek
kepek / svg-optimize.sh
Created March 12, 2017 07:26
Optimize svg files.
#!/bin/sh
for f in ./images/**/*.svg; do
svgo $f $f
done