Skip to content

Instantly share code, notes, and snippets.

View HyunSeob's full-sized avatar
😴
Lazy

HyunSeob HyunSeob

😴
Lazy
View GitHub Profile
@HyunSeob
HyunSeob / init.coffee
Last active January 17, 2017 15:19
My Atom setting.
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@HyunSeob
HyunSeob / type-annotation-func.ts
Created October 2, 2016 09:54
TypeScript: Basic Type
function echo(param: string): string {
return param;
}
exports.handler = (event, context, callback) => {
const result = event.num * 2;
callback(null, result);
};
const _ = require('lodash');
exports.handler = (event, context, callback) => {
const result = _.range(1, event.num + 1);
callback(null, result);
};
const AWS = require('aws-sdk');
const BUCKET_NAME = 'your-s3-bucket-name';
const s3 = new AWS.S3();
exports.handler = (event, context, callback) => {
const { name, body } = event;
s3.putObject({
Bucket: BUCKET_NAME,
{
"name": "apex-typescript-example",
"description": "",
"memory": 128,
"timeout": 5,
"role": "your-iam-role",
"handler": "lib.default",
"environment": {},
"hooks": {
"clean": "rm -rf lib",
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './src/index.ts',
target: 'node',
output: {
path: path.join(process.cwd(), 'lib'),
filename: 'index.js',
libraryTarget: 'commonjs2',
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "output",
"sourceMap": false,
"experimentalDecorators": true,
"allowJs": true,
"moduleResolution": "node",
"baseUrl": ".",
console.log('starting function');
export default (e, ctx, cb) => {
console.log('processing event: %j', e);
cb(null, { hello: 'world' });
};
{
"description": "Hello function",
"runtime": "nodejs6.10",
"memory": 128,
"timeout": 5,
"role": "your-iam-role"
}