Skip to content

Instantly share code, notes, and snippets.

View LuisCusihuaman's full-sized avatar
🛸
refactorin' code

edu LuisCusihuaman

🛸
refactorin' code
View GitHub Profile
import sys
from datetime import timedelta
total_time = sys.argv[1].split('.') # 2.35 is 2hr 35min
delta = timedelta(hours=int(total_time[0]), minutes=int(total_time[1]))
minutes = delta.total_seconds() / 60
total_pomodoros = round(minutes / 25)
print(f'🕒{total_pomodoros} Pomodoros')
@raneomik
raneomik / wsl-terminator.vbs
Last active January 27, 2024 03:58
vbscript to run Terminator and xServer under wsl
' https://medium.com/@bhupathy/install-terminator-on-windows-with-wsl-2826591d2156
set shell = CreateObject("Wscript.Shell")
xServerProcessName = "vcxsrv.exe"
RunXserverProcess( xServerProcessName )
RunTerminator()
KillXserverProcess( xServerProcessName )
@holmberd
holmberd / deploy-keys.md
Last active February 11, 2024 20:36
Setup GitHub repository SSH deploy keys

Setup GitHub repository SSH deploy keys

  1. Create GitHub repository in github and save the SSH repository url

  2. Init git on server in code directory

  • git init
  1. Create SSH keys on the server
  • ssh-keygen -t rsa -b 4096 -C your@email.here
  • Rename the key that doesn't end with .pub to repo-name.deploy.pem
@sathiyaseelan
sathiyaseelan / golang_setup.md
Last active April 1, 2024 18:51
Basics to setup a golang project repo in your local

Simple Guide to setup Golang in your Mac and clone a repo.

Setup Go and workspace

Type go in terminal, to verify the installation.

  • Create a Go workspace and set GO PATH
variable "sdd_snapshot_description" {
description = "This is the description that will be used to identify the snapshots of our data volume. We will filter against this value."
default = "sdd-data-snapshot"
}
provider "aws" {}
// Get the latest version of our /dev/sdd snapshot
data "aws_ebs_snapshot" "sdd_snapshot" {
most_recent = true
@minhchu
minhchu / app.js
Created February 28, 2017 07:17
Nginx and Express Morgan configurations for logging in production
'use strict';
const app = express();
...
app.set('trust proxy', true);
if (process.env.ENVIRONMENT == 'development') {
app.use(logger('dev'));
} else {
@leonardofed
leonardofed / README.md
Last active September 19, 2024 07:07
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@tony-gutierrez
tony-gutierrez / AWS_Single_LetsEncrypt.yaml
Last active March 7, 2024 11:29
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
@lancejpollard
lancejpollard / node-folder-structure-options.md
Created November 28, 2011 01:50
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin