- Initialize project
npm init -y
- Create esm module
./src/esm/my-lib.js
function addNumber(value, value2) { return value + value2; } export { addNumber };
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const comments: QueryResolvers['comments'] = async ({ | |
parentType, | |
parentId, | |
}) => { | |
const commentable = parentType[0].toLowerCase() + parentType.substring(1) | |
validateWith(() => { | |
if (!Object.values(Commentable).includes(commentable)) { | |
throw new Error( | |
'Invalid commentable passed in, check your value for parentType' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import Foundation; | |
@import AVFoundation; | |
@import VideoToolbox; | |
@import AudioToolbox; | |
void videoCompressTest(void); | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
videoCompressTest(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Alternative version | |
const { PublishManager } = require('app-builder-lib/out/publish/PublishManager'); | |
const { normalizeOptions } = require('electron-builder/out/builder'); | |
const { Packager } = require('app-builder-lib/out/packager'); | |
const pkg = require('../package.json'); | |
const argv = require('yargs').argv; | |
const buildFile = argv.file.replace('${version}', pkg.version); | |
const buildDir = argv.buildDir || './build/'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import AVFoundation | |
import Photos | |
import MobileCoreServices | |
class ViewController: UIViewController { | |
override func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) | |
startVideoToGIFProcess() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ValuesOf<T> = T extends { [key: string]: infer T } ? T : never | |
// type Parameters<T> = T extends (...args: infer T) => any ? T : never | |
type FirstParameter<T> = T extends (first: infer T, ...args: any) => any ? T : never | |
type SecondParameter<T> = T extends (first: any, second: infer T, ...args: any) => any ? T : never | |
type PromiseValue<T> = T extends Promise<infer U> | |
? U | |
: T extends (...args: any[]) => Promise<infer U> | |
? U | |
: T | |
type Require<T, P extends keyof T> = T & Required<Pick<T, P>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Victor on 1/16/19. | |
// Copyright © 2019 tchop. All rights reserved. | |
// | |
// https://medium.com/samkirkiles/swift-using-avassetwriter-to-compress-video-files-for-network-transfer-4dcc7b4288c5 | |
import Foundation | |
import AVFoundation | |
class VideoConverter { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"apigateway:*", | |
"cloudformation:CancelUpdateStack", | |
"cloudformation:ContinueUpdateRollback", | |
"cloudformation:CreateChangeSet", | |
"cloudformation:CreateStack", | |
"cloudformation:CreateUploadBucket", |
NewerOlder