Skip to content

Instantly share code, notes, and snippets.

View kostapappas's full-sized avatar

LAMPROS KOSTAPAPPAS kostapappas

View GitHub Profile
@kostapappas
kostapappas / uploadDsym manually with crashlytics
Created May 15, 2020 09:54
upload dsym with crashlytics
#run from project root directory. Add dsyms at route directory
./Pods/FirebaseCrashlytics/upload-symbols -gsp ./GoogleService-Info.plist -p ios ./dyms1.zip
@kostapappas
kostapappas / JsonToString.swift
Created September 3, 2019 10:15
Json Data to String (for debug reasons)
private func stringify(jsonData: Data) -> String {
do {
let array = try JSONSerialization.jsonObject(with: jsonData, options: []) as? [String: Any]
let jsonData2 = try JSONSerialization.data(withJSONObject: array,
options: .prettyPrinted)
// here "jsonData" is the dictionary encoded in JSON data
let jsonString = String(data: jsonData2, encoding: .utf8) ?? ""
let result = String(jsonString.filter { !" \n\t\r".contains($0) })
return result
} catch {
@kostapappas
kostapappas / customViewControllerforHotReload.swift
Created July 18, 2019 05:41
Custom ViewController for hotreload
extension ContactUsViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.initializeViews()
}
}
class ContactUsViewController: BaseSearchViewController {
@IBOutlet weak var searchBarTextField: UITextField!
@kostapappas
kostapappas / customViewForHotReload.swift
Last active July 18, 2019 05:35
customView for hotreload
import UIKit
import Stevia
final class ContactUsView: UIView {
private var container = UIView()
@objc func injected() {
initialSetup()
}
@kostapappas
kostapappas / basicRowColumn.dart
Last active July 4, 2019 16:26
basic flutter UI
new Container(
padding: new EdgeInsets.all(8.0),
height: 250.0,
child: textExample,
)
final row = new Row(
children: <Widget>[
textExample,
textExample,
@kostapappas
kostapappas / CIFilter+Extension.swift
Created May 28, 2019 15:20 — forked from ha1f/CIFilter+Extension.swift
CIFilter+Extension.swift
//
// Created by はるふ on 2017/12/11.
// Copyright © 2017年 ha1f. All rights reserved.
//
import Foundation
import CoreImage
import AVFoundation
extension CIFilter {
@kostapappas
kostapappas / filter.swift
Created May 28, 2019 15:20 — forked from seivan/filter.swift
Sample CIFilter with Swift.
@objc class JPTiltShiftGenerator: NSObject, CIFilterConstructor {
@objc func filterWithName(name: String)->CIFilter? {
return JPTiltShift()
}
}
class JPTiltShift : CIFilter {
class func register() {
@kostapappas
kostapappas / CIFilter+Extension.swift
Created May 28, 2019 15:19 — forked from Umity/CIFilter+Extension.swift
CIFilter+Extension.swift
//
// Created by はるふ on 2017/12/11.
// Copyright © 2017年 ha1f. All rights reserved.
//
import Foundation
import CoreImage
import AVFoundation
extension CIFilter {
@kostapappas
kostapappas / pushNotifiations.js
Last active May 9, 2020 11:44
Firebase javascript function to send push notification when a new item added in firestore
const functions = require('firebase-functions');
const admin = require("firebase-admin");
admin.initializeApp();
exports.notifyNewMessage = functions.firestore
.document('365BetaCannels2/{chanl}/thrad/{messe}')
.onCreate((docSnapshot, context) => {
const message = docSnapshot.data();
const recipientId = message['recipientID'];
@kostapappas
kostapappas / uibutton indexpath row section
Created December 15, 2018 08:56
add row, sector, indexpath in button
extension UIButton {
private struct AssociatedKeys {
static var section = "section"
static var row = "row"
}
var section: Int {
get {
guard let number = objc_getAssociatedObject(self, &AssociatedKeys.section) as? Int else {