Skip to content

Instantly share code, notes, and snippets.

View cassmtnr's full-sized avatar
☀️
Praise the Sun

Cassiano cassmtnr

☀️
Praise the Sun
  • DKB Code Factory GmbH
  • Leipzig, Germany
  • 20:32 (UTC +02:00)
View GitHub Profile
@cassmtnr
cassmtnr / HomeDateGreeting.js
Last active June 7, 2022 07:29
Date and Greeting with Unsplash Collection Background
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: home;
let collection = "932809";
const FORCE_IMAGE_UPDATE = true;
// Store current datetime
const date = new Date();
@cassmtnr
cassmtnr / quantityDownloads.js
Last active October 9, 2020 03:17
Scriptable quantity downloads
let quantity = "500.000";
let widget = new ListWidget();
let widgetInputRAW = args.widgetParameter;
if (widgetInputRAW) {
try {
widgetInputRAW.toString();
@cassmtnr
cassmtnr / axios-interceptors-refresh-token.js
Created April 2, 2019 17:52 — forked from mkjiau/axios-interceptors-refresh-token.js
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@cassmtnr
cassmtnr / carousel.js
Created February 4, 2019 19:50
react-native-carousel-view
@cassmtnr
cassmtnr / form.js
Created February 1, 2019 11:55
RN Form with Formik
import React, { PureComponent, Fragment } from 'react';
import { View, ScrollView } from 'react-native';
import { withFormik } from 'formik';
import ButtonLoading from '../../../react-component/buttonLoading';
import InputComponent from '../../../components/inputComponent';
import { enderecoSchema } from '../../../constants/schemas';
@cassmtnr
cassmtnr / upload-image-to-s3.js
Last active August 20, 2019 03:32
upload-image-to-s3
'use strict';
let config = {
AWS = {
accessKeyId: ACCESSKEYHERE,
secretAccessKey: SECRETEACCESSKEYHERE,
region: REGIONHERE
}
}
@cassmtnr
cassmtnr / aws-s3.js
Created January 26, 2018 12:26 — forked from wharley/aws-s3.js
upload
'use strict'
const AWS = require('aws-sdk')
const env = require('../../.env')
const formidable = require('formidable')
const fs = require('fs')
const sendErrorsFromDB = (res, dbErros) => {
const errors = []
_.forIn(dbErros.errors, error => errors.push(error.message))
return res.status(400).json({ errors })