Skip to content

Instantly share code, notes, and snippets.

View loloDawit's full-sized avatar
💭
I may be slow to respond.

Dawit loloDawit

💭
I may be slow to respond.
  • Nordstrom
  • Seattle
View GitHub Profile
@loloDawit
loloDawit / gist:5117eb4ca95c1f5ed47b
Created January 24, 2016 00:25
AutoLoanCalculator
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.text.MessageFormat;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
export CLANG_MODULES_BUILD_SESSION_FILE=/Users/dawitabera/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation
export CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING=YES
export CLANG_WARN_BOOL_CONVERSION=YES
export CLANG_WARN_COMMA=YES
export CLANG_WARN_CONSTANT_CONVERSION=YES
export CLANG_WARN_DIRECT_OBJC_ISA_USAGE=YES_ERROR
export CLANG_WARN_EMPTY_BODY=YES
export CLANG_WARN_ENUM_CONVERSION=YES
export CLANG_WARN_INFINITE_RECURSION=YES
export CLANG_WARN_INT_CONVERSION=YES
@loloDawit
loloDawit / serverless.yml
Last active March 21, 2021 18:12
Serverless config
service: serverless-restapi
frameworkVersion: '2'
provider:
name: aws
runtime: nodejs14.x
stage: ${opt:stage}
region: us-east-1
lambdaHashingVersion: 20201221
@loloDawit
loloDawit / db.js
Created March 20, 2021 23:14
Database connection
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
module.exports = connectDataBase = async () => {
try {
const databaseConnection = await mongoose.connect(process.env.DB, {
useUnifiedTopology: true,
useNewUrlParser: true,
useCreateIndex: true,
@loloDawit
loloDawit / handler.js
Created March 20, 2021 23:39
Handler
require('dotenv').config({ path: './.env' });
const isEmpty = require('lodash.isempty');
const validator = require('validator');
const connectToDatabase = require('./db');
const Note = require('./models/Note');
/**
* Helper function
* @param {*} statusCode
@loloDawit
loloDawit / handler.js
Last active February 14, 2024 04:31
Lambda handler functions
require('dotenv').config({ path: './.env' });
const isEmpty = require('lodash.isempty');
const validator = require('validator');
const connectToDatabase = require('./db');
const Note = require('./models/Note');
/**
* Helper function
* @param {*} statusCode
@loloDawit
loloDawit / Note.js
Last active March 21, 2021 14:54
Note Model
const mongoose = require('mongoose');
const validator = require('validator');
const NoteSchema = new mongoose.Schema(
{
title: {
type: String,
required: true,
validator: {
validator(title) {
@loloDawit
loloDawit / serverless.yml
Last active March 21, 2021 18:27
snippet
....
provider:
....
apiGateway:
apiKeys:
- free:
- ${opt:stage}-freekey
- paid:
- ${opt:stage}-prokey
@loloDawit
loloDawit / installserverless.sh
Created November 19, 2021 01:19
installserverless
❯ npm install -g serverless
@loloDawit
loloDawit / package.json
Last active November 19, 2021 01:49
code Snippet
"scripts": {
"lint": "./node_modules/eslint/bin/eslint.js .",
"release": "release-it",
"version": "auto-changelog - template changelog.hbs -p && git add CHANGELOG.md",
"test": "serverless-bundle test"
},