Skip to content

Instantly share code, notes, and snippets.

View ikbelkirasan's full-sized avatar

Ikbel ikbelkirasan

View GitHub Profile
@MatthewJDavis
MatthewJDavis / aws-server.yaml
Last active May 23, 2019 04:43
AWS cloudformation YAML template
AWSTemplateFormatVersion: 2010-09-09
Description: Create a basic Amazon Linux Server with security group in existing VPC and subnet
Parameters:
KeyName:
Description: Key Pair name
Type: 'AWS::EC2::KeyPair::KeyName'
Default: keyPair
VPC:
Description: Select a VPC
Type: 'AWS::EC2::VPC::Id'
@motia
motia / auth-middleware.js
Last active August 19, 2017 22:15
Nuxt JWT
export default async function ({ store, route, redirect }) {
store.dispatch('auth/loadToken')
const hasToken = Boolean(store.state.auth.token)
const isLoggedIn = store.state.auth.loggedIn
// if have a token
if (hasToken) {
if (route.path === '/login') {
redirect('/')
return
@wwwebman
wwwebman / docker-compose.yml
Last active February 3, 2023 05:28
Docker Compose For Wordpress, Maria/MYSQL, phpMyAdmin
version: '2'
services:
db:
container_name: database
image: mariadb # Pull mysql image from Docker Hub
ports: # Set up ports exposed for other containers to connect to
- "3306:3306"
volumes:
- ./dep/mysql:/docker-entrypoint-initdb.d
@kamalkhan
kamalkhan / component.js
Created April 16, 2017 12:56
Vue deep model directive
const component = Vue.extend({
template: `<input v-deep-model="'one.two.three'">`,
data() {
return {
one: { two: { three: 'foo' } }
};
}
});
@cweilguny
cweilguny / docker-compose-gitlab.yml
Last active October 27, 2021 00:55
A docker-compose config in v3 format for nginx-proxy with separate containers for nginx, dockergen and letsencrypt-companion. Additional example on how to get GitLab docker container running with this nginx-proxy setup. You need to create the docker network before, just run 'docker network create nginx-proxy'. Docker will tell you so if you don'…
version: '3'
services:
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com'
nginx['listen_port'] = 80
@michaelneu
michaelneu / Dockerfile
Last active October 17, 2022 05:37
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:5-fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysql mysqli sysvsem
RUN pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@gildas
gildas / promise-series.js
Created February 13, 2017 00:52
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) {
@nasrulhazim
nasrulhazim / readme.md
Last active June 2, 2021 19:42
Send Welcome Email Notification with Event and Listener

Send Welcome Email Notification with Event and Listener

Step 1

Create SendWelcomeEmailNotification notification

php artisan make:notification SendWelcomeEmailNotification
@bradgignac
bradgignac / main.tf
Created January 11, 2017 14:41
Terraform Example
/* Providers */
provider "aws" {
region = "us-west-2"
}
/* Variables */
variable "name" {
default = "XXXXX"
@niieani
niieani / throttle-and-debounce.sh
Last active September 21, 2024 21:50
throttle and debounce commands in bash
#!/usr/bin/env bash
declare -i last_called=0
declare -i throttle_by=2
@throttle() {
local -i now=$(date +%s)
if (($now - $last_called >= $throttle_by))
then
"$@"