Skip to content

Instantly share code, notes, and snippets.

View ikbelkirasan's full-sized avatar

Ikbel ikbelkirasan

View GitHub Profile
@ikbelkirasan
ikbelkirasan / .vimrc
Last active August 5, 2019 12:40 — forked from leolord/vim.sh
Compiling vim on Ubuntu 18 with LUA-support
" vim-bootstrap
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
let g:vim_bootstrap_langs = "c,elixir,elm,erlang,go,haskell,html,javascript,lisp,lua,ocaml,perl,php,python,rust,scala,typescript"
let g:vim_bootstrap_editor = "vim" " nvim or vim
@ikbelkirasan
ikbelkirasan / main.tf
Created June 2, 2019 03:42 — forked from bradgignac/main.tf
Terraform Example
/* Providers */
provider "aws" {
region = "us-west-2"
}
/* Variables */
variable "name" {
default = "XXXXX"
@ikbelkirasan
ikbelkirasan / README.md
Created September 21, 2018 04:27 — forked from joyrexus/README.md
Node.js streams demystified

A quick overview of the node.js streams interface with basic examples.

This is based on @brycebaril's presentation, Node.js Streams2 Demystified

Overview

Streams are a first-class construct in Node.js for handling data.

Think of them as as lazy evaluation applied to data.

@ikbelkirasan
ikbelkirasan / sns-publish-helper.js
Created August 3, 2018 20:36 — forked from DavidWells/sns-publish-helper.js
SNS util methods for easier publishing with promises
const AWS = require('aws-sdk');
const sns = new AWS.SNS();
function snsEventToJson(sns) {
return JSON.parse(sns.Records[0].Sns.Message);
}
function jsonToSnsParams(jsonObject) {
return {
Message: JSON.stringify(jsonObject)
@ikbelkirasan
ikbelkirasan / function.js
Created July 31, 2018 18:15 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

Steps:

  1. Open VirtualBox
  2. Right-click your VM, then click Settings
  3. Go to Shared Folders section
  4. Add a new shared folder
  5. On Add Share prompt, select the Folder Path in your host that you want to be accessible inside your VM.
@ikbelkirasan
ikbelkirasan / promise-series.js
Created June 18, 2018 05:41 — forked from gildas/promise-series.js
execute promises in series
// Promise returning functions to execute
function doFirstThing(){ return Promise.resolve(1); }
function doSecondThing(res){ return Promise.resolve(res + 1); }
function doThirdThing(res){ return Promise.resolve(res + 2); }
function lastThing(res){ console.log("result:", res); }
var fnlist = [ doFirstThing, doSecondThing, doThirdThing, lastThing];
// Execute a list of Promise return functions in series
function pseries(list) {
@ikbelkirasan
ikbelkirasan / select-file.vue
Created June 4, 2018 20:04 — forked from ecmel/select-file.vue
Vuetify Multiple File Select and Preview
<script>
export default {
name: 'VSelectFile',
model: {
prop: 'value',
event: 'change'
},
props: {
label: {
type: String,
@ikbelkirasan
ikbelkirasan / laravel-multiple-env-setup.php
Created April 9, 2018 19:04 — forked from msankhala/laravel-multiple-env-setup.php
Setup Multiple Environment for Laravel 5 Developers Way
<?php
/*
|--------------------------------------------------------------------------
| Follow this instructions:
|--------------------------------------------------------------------------
|
| Laravel takes a dead simple approach to your application environments
| so you can just specify a machine name for the host that matches a
| given environment, then we will automatically detect it for you.
@ikbelkirasan
ikbelkirasan / S3-Static-Sites.md
Created April 5, 2018 01:27 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources