This file contains 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
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { | |
if(self.tableView.respondsToSelector(Selector("setSeparatorInset:"))){ | |
self.tableView.separatorInset = UIEdgeInsetsZero | |
} | |
if(self.tableView.respondsToSelector(Selector("setLayoutMargins:"))){ | |
self.tableView.layoutMargins = UIEdgeInsetsZero | |
} | |
if(cell.respondsToSelector(Selector("setLayoutMargins:"))){ |
This file contains 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
func getFontsAvailable(){ | |
var fontFamilies = UIFont.familyNames() | |
for index in 0..<fontFamilies.count{ | |
let fontFamily = fontFamilies[index] | |
let fontNames: NSArray = UIFont.fontNamesForFamilyName(fontFamilies[index] as String) as NSArray | |
print("\(fontFamily), \(fontNames)") | |
} | |
} |
This file contains 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
{ | |
"data": { | |
"media": [ | |
{ | |
"type": "course", | |
"title": "Conscious Parenting", | |
"coverAsset": { | |
"url": "https://assets.mindvalley.com/api/v1/assets/5bdbdd0e-3bd3-432b-b8cb-3d3556c58c94.jpg?transform=w_1080" | |
}, | |
"channel": { |
This file contains 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
exports.onUserCreate = functions.auth.user().onCreate((user) => { | |
console.log("User created") | |
}); |
This file contains 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
/// on post created | |
exports.documentCreate = functions.firestore | |
.document('document/{documentId}') | |
.onCreate((change, context) => { | |
console.log("Document created") | |
}); |
This file contains 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
const functions = require('firebase-functions') | |
const { Telegraf } = require('telegraf') | |
const bot = new Telegraf(functions.config().bot.token) |
This file contains 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
exports.onUserCreate = functions.auth.user().onCreate((user) => { | |
bot.telegram.sendMessage(functions.config().bot.chat, '🎉 New user joined') | |
}); |
This file contains 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
/// on post created | |
exports.documentCreate = functions.firestore | |
.document('document/{documentId}') | |
.onCreate((change, context) => { | |
bot.telegram.sendMessage(functions.config().bot.chat, '📄 New post created') | |
}); |
This file contains 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
#requires ffmpeg to be installed | |
import os | |
from tempfile import NamedTemporaryFile | |
import subprocess | |
import math | |
import openai | |
async def _transcribe_audio(audio_file): | |
openai.api_key = OPEN_API_KEY |