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
import Sound from 'react-native-sound'; | |
const sound = new Sound('http://sounds.com/some-sound', null, (error) => { | |
if (error) { | |
// do something | |
} | |
// play when loaded | |
sound.play(); | |
}); |
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
import Video from 'react-native-video'; | |
// From documentation | |
<Video source={{uri: "background"}} // Can be a URL or a local file. | |
ref={(ref) => { | |
this.player = ref | |
}} // Store reference | |
rate={1.0} // 0 is paused, 1 is normal. | |
volume={1.0} // 0 is muted, 1 is normal. | |
muted={false} // Mutes the audio entirely. |
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
import { AudioRecorder, AudioUtils } from 'react-native-audio'; | |
let audioPath = AudioUtils.DocumentDirectoryPath + '/test.aac'; | |
AudioRecorder.prepareRecordingAtPath(audioPath, { | |
SampleRate: 22050, | |
Channels: 1, | |
AudioQuality: "Low", | |
AudioEncoding: "aac" | |
}); |
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 soundObject = new Expo.Audio.Sound(); | |
try { | |
await soundObject.loadAsync(require('./assets/sounds/hello.mp3')); | |
await soundObject.playAsync(); | |
// Your sound is playing! | |
} catch (error) { | |
// An error occurred! | |
} |
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
backend: | |
name: git-gateway | |
branch: master | |
media_folder: static/img | |
public_folder: /img | |
collections: | |
- name: "blog" | |
label: "Blog" |
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
require("dotenv").config(); // read .env file if present. | |
const nodemailer = require("nodemailer"); | |
const createHtmlMail = require("./modules/mail-template"); // this function returns html email code | |
exports.handler = function(event, context, callback) { | |
const user = process.env.MAIL_USER; // some@mail.com | |
const pass = process.env.MAIL_PASSWORD; // 42isthecoolestnumber | |
let transporter = nodemailer.createTransport({ |
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 { MongoClient } = require('mongodb'); | |
const DB_URL = process.env.DB_URL || 'mongodb://localhost:27017'; | |
const DB_NAME = 'serverless-smoothielicious'; | |
function errorResponse(callback, err) { | |
console.error(err); | |
callback(null, { | |
statusCode: 500, |
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
<mjml> | |
<mj-head> | |
<mj-title>My Title</mj-title> | |
<mj-attributes> | |
<mj-class | |
name="text" | |
font-family="Open Sans, Arial" | |
color="#111111" | |
font-size="16px" | |
line-height="26px"> |
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
<container> | |
<style> | |
.columns { | |
border: 1px solid #333; | |
} | |
</style> | |
<row> | |
<columns small="6" large="4">4 columns, 6 columns on small</columns> | |
<columns small="6" large="8">8 columns, 6 columns on small</columns> |
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 { WebClient } = require('@slack/client'); | |
const fetch = require("node-fetch"); | |
const API_URL = 'http://ron-swanson-quotes.herokuapp.com/v2/quotes'; | |
const CHANNEL_ID = 'D6X9SM885'; | |
module.exports = async (context, cb) => { | |
const [quote] = await fetch(API_URL).then(res => res.json()); | |
const { chat } = new WebClient(context.secrets.SLACK_TOKEN); |