Skip to content

Instantly share code, notes, and snippets.

💭
existing

Doruk Kutlu d0ruk

💭
existing
  • İstanbul
Block or report user

Report or block d0ruk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View promisified.js
function connect(uri, opts, that) {
return new Promise((resolve. reject) => {
that.mongoClient.connect(uri, opts, (err, client) => {
if (err) return reject(err)
return resolve(client)
}
})
}
View pinpoint-cloudformation-template.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Pinpoint resource stack creation using Amplify CLI",
"Parameters": {
"appName": {
"Type": "String"
},
"appId": {
"Type": "String",
"Default": "NONE"
@d0ruk
d0ruk / cloudformation.yaml
Created Mar 21, 2019 — forked from alexjurkiewicz/cloudformation.yaml
Verdaccio CloudFormation template
View cloudformation.yaml
# Instructions:
# 1. Check all "TODO" comments and make changes if required for your environment
# 2. Provide values for all required parameters and any optional parameters desired
AWSTemplateFormatVersion: '2010-09-09'
Description: Verdaccio - NPM cache / private registry
Parameters:
# REQUIRED PARAMETERS
Ami:
Type: AWS::EC2::Image::Id
@d0ruk
d0ruk / index.html
Last active Apr 10, 2019
bl.ocks.org/d0ruk/9f019002e43043503e9d4b7d6f0b0343
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>react app</title>
<link href="https://fonts.googleapis.com/css?family=Unlock" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/rc-tooltip@latest/assets/bootstrap_white.css">
<style>
@d0ruk
d0ruk / docker-compose.yml
Created Nov 27, 2018
nodemon with express+mongoose
View docker-compose.yml
version: "3"
services:
mongo:
image: mvertes/alpine-mongo
hostname: mongo
ports:
- 27017:27017
View readme.md

Quick Start with docker-compose

  • Add a new service in docker-compose.yml
version: '2'
services:
  openvpn:
    cap_add:
     - NET_ADMIN
@d0ruk
d0ruk / cli.docker.sh
Created Sep 4, 2018 — forked from LeCoupa/cli.docker.sh
Docker Cheatsheet + Tips & Tricks --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View cli.docker.sh
docker build -t friendlyname . # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname # Same thing, but in detached mode
docker exec -it [container-id] bash # Enter a running container
docker ps # See a list of all running containers
docker stop <hash> # Gracefully stop the specified container
docker ps -a # See a list of all containers, even the ones not running
docker kill <hash> # Force shutdown of the specified container
docker rm <hash> # Remove the specified container from this machine
docker rm $(docker ps -a -q) # Remove all containers from this machine
View gist:c0a2ce4562b4c16bf0f6d64b877f421f
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@d0ruk
d0ruk / cognito.yaml
Created Dec 2, 2017 — forked from singledigit/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
View cognito.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
View aws-host-static.js
const fs = require("fs");
const path = require("path");
const Promise = require("bluebird");
const readdir = require("recursive-readdir");
const { bgRed, bgGreen, bgBlue, bold, white } = require("chalk");
const PKG = require("./package.json");
const AWS = require("aws-sdk");
const s3 = new AWS.S3();
const bucketName = `${PKG.name}-v${PKG.version}`;
You can’t perform that action at this time.