Skip to content

Instantly share code, notes, and snippets.

View boskiv's full-sized avatar

Ivan Skiridomov boskiv

  • ZFX
  • Cyprus
  • 13:48 (UTC +03:00)
View GitHub Profile
@boskiv
boskiv / gifts.component.ts
Created September 8, 2020 17:58
gifts.component.ts
import { Component, OnInit, ViewChild } from '@angular/core';
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
import { Gift } from '@nx-koko/shared/interfaces';
import { Observable } from 'rxjs';
import { catchError, finalize, map, tap } from 'rxjs/operators';
import { GiftService } from '@nx-koko/shared/services';
import { AngularFireStorage } from '@angular/fire/storage';
@Component({
selector: 'nx-koko-gifts',
@boskiv
boskiv / pond.ts
Created September 8, 2020 16:49
pond.ts
pondOptions = {
class: 'my-filepond',
multiple: true,
allowFileRename: true,
fileRenameFunction: file => {
return this.afs.createId()
},
labelIdle: 'Drop files here',
acceptedFileTypes: 'image/jpeg, image/png',
allowFileEncode: true,
@boskiv
boskiv / exportOptionsAdHoc.plist
Created September 4, 2019 12:30 — forked from cocoaNib/exportOptionsAdHoc.plist
Xcode build with exportOptionsPlist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
</dict>
</plist>
@boskiv
boskiv / exportOptions.plist
Created September 4, 2019 12:30 — forked from skabber/exportOptions.plist
Export Options Plist Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>app-store</string>
<key>teamID</key>
<string>XXXXXXXXXX</string>
<key>uploadBitcode</key>
<true/>
@boskiv
boskiv / custom-token.js
Created September 4, 2019 09:41 — forked from pixelastic/custom-token.js
Firebase function to return an Auth0 custom token
import cors from 'cors';
import Promise from 'bluebird';
import axios from 'axios';
import database from '../database/database.js';
/**
* The goal of this function is to mint custom token that can be used to
* authenticate to Firebase.
* The function will be called through https, and will check the credentials of
* the requested user (through the usage of its Auth0 token). If the Auth0 token
@boskiv
boskiv / rbac-config.yaml
Created August 28, 2019 12:35
simple helm rbac config
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller

I have this kind of code

 @UseGuards(AuthGuard('local'))
  @Post('login')
  login(@Request() req) {
    const foo = 1;

    return this.authService.login(req);
 }
@boskiv
boskiv / StreamToString.go
Last active August 14, 2019 13:14 — forked from tejainece/StreamToString.go
Golang: io.Reader stream to string or byte slice
import "bytes"
func StreamToByte(stream io.Reader) []byte {
buf := new(bytes.Buffer)
buf.ReadFrom(stream)
return buf.Bytes()
}
func StreamToString(stream io.Reader) string {
buf := new(bytes.Buffer)
@boskiv
boskiv / log.go
Created August 12, 2019 10:10 — forked from gonzaloserrano/log.go
logrus wrapper
package log
import (
"fmt"
"github.com/Sirupsen/logrus"
"runtime"
"strings"
)
var logger = logrus.New()