Skip to content

Instantly share code, notes, and snippets.

View uurtech's full-sized avatar
✈️
Works

Ugur KAZDAL uurtech

✈️
Works
View GitHub Profile
@rtgibbons
rtgibbons / logger.js
Created November 7, 2013 13:51
Logger Library with winston
var app = require(process.cwd() + '/app');
var winston = require('winston');
var _ = require('lodash');
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'green',
warn: 'yellow',
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 3, 2024 12:59
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@jibs
jibs / gcloud-port-forward.md
Created April 25, 2015 15:57
port forwarding with a google cloud instance

Google cloud's ssh command lets you pass standard ssh flags. To, for example, forward local port 8088 to port 8088 on a vm instance, all you need to do is:

gcloud compute  ssh --ssh-flag="-L 8088:localhost:8088"  --zone "us-central1-b" "example_instance_name"

Now browsing to localhost:8088 works as it would with standard ssh.

@ichadhr
ichadhr / jekyll-post-thor.md
Last active February 8, 2024 10:27
Jekyll create post with command

CREATE JEKYLL POSTS FROM THE COMMAND LINE

I got tired on creating new files manually for each new post a write so I put together this little command line task with Thor.

It creates a new file in the _posts directory with today’s date, parses the parameters to command as the post’s title and adds that as a slug to the new file. It then writes a default yaml template to the file (as specified in the script).

Running thor jekyll:new New and shiny post will for example create the file _posts/2012-12-28-new-and-shiny-post.markdown, populate it with an yaml template and finally open the file in my favorite editor.

HOW TO

Add the following to your Gemfile:

@yetanotherchris
yetanotherchris / install-rabbitmq.sh
Last active April 29, 2023 07:10
RabbitMQ on Docker with admin UI
# AWS specific install of Docker
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
# exit the SSH session, login again
# Docker
docker run -d --hostname my-rabbit --name some-rabbit -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 15672:15672 rabbitmq
@jgrodziski
jgrodziski / docker-aliases.sh
Last active April 30, 2024 17:46
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@arxdsilva
arxdsilva / working_directory.go
Last active February 12, 2024 13:30
How to get the current working directory in golang
package main
// More info on Getwd()
// https://golang.org/src/os/getwd.go
//
import(
"os"
"fmt"
"log"
)
@vikas5914
vikas5914 / log.js
Last active December 12, 2023 14:09
Custom Logger Library with winston
const { createLogger, format, transports } = require('winston')
const moment = require('moment')
// set default log level.
const logLevel = 'info'
var logger = createLogger({
level: logLevel,
levels: {
fatal: 0,
@xameeramir
xameeramir / default nginx configuration file
Last active April 27, 2024 12:35
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@alexsasharegan
alexsasharegan / waitgroup.ts
Last active April 1, 2020 08:58
Nodejs implementation of the Golang waitgroup.
import { EventEmitter } from "events"
export class WaitGroup extends EventEmitter {
public state: number
constructor(initialState: number = 0) {
if (initialState < 0) {
throw new RangeError()
}
super()