Skip to content

Instantly share code, notes, and snippets.

View deivinsontejeda's full-sized avatar
🎯

Deivinson Tejeda deivinsontejeda

🎯
  • Santiago of Chile
View GitHub Profile
@deivinsontejeda
deivinsontejeda / ssl_puma.sh
Created December 21, 2023 20:17 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@deivinsontejeda
deivinsontejeda / jwt-expiration.md
Created May 24, 2020 17:57 — forked from soulmachine/jwt-expiration.md
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@deivinsontejeda
deivinsontejeda / ladder.md
Created March 7, 2018 01:48 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@deivinsontejeda
deivinsontejeda / component.js
Created February 13, 2018 20:22 — forked from adamesque/component.js
Ember Component Life-cycle Docs Feedback
import Ember from 'ember';
export default Ember.Component.extend({
/**
Overall thoughts: Ember.Component needs a section in the module doc block outlining the order of events (just like the 1.13 blog post).
Individual events can then refer back to that lifecycle chart to avoid the "runs xth during re-renders but only on thursdays" sentences.
The module doc block should also get the section on what triggers a re-render (from the 1.13 blog post).
*/
myProp: null,
@deivinsontejeda
deivinsontejeda / request.js
Last active February 7, 2016 01:36
Tiny service which use ember-simple-auth 1.0.0 and wrap any remote call.
import Ember from 'ember';
/**
* This service wrap any remote call which needs authorization
* in order to set necessary headers to being authorized
* once the user is logged in
*
*/
const { inject } = Ember;
@deivinsontejeda
deivinsontejeda / docker-command.md
Last active October 5, 2015 16:11
Docker Command

This is a list of Docker command I often use. This does not intend to be a accurate command reference about Docker, it's just a way to not forget some commands

List all Volumens

for x in $(docker ps -qa | sed '1d'); do docker inspect -f '{{ .Volumes }}' ${x}; done

Stop Container by Name

docker ps -a | grep datacollector | awk '{ print $1 }' | xargs docker stop
package main
import (
"fmt"
)
const (
GOROTUNIES = 2
)

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
IRB.conf[:EVAL_HISTORY] = 1000
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = File::expand_path("~/.irbhistory")
#begin
# require 'pry'
# Pry.start
#rescue LoadError
# puts "you need run 'gem install pry'"
@deivinsontejeda
deivinsontejeda / gist:7721060
Last active September 15, 2017 12:46
.gemrc
---
:verbose: false
install: --no-document --env-shebang
:sources:
- https://rubygems.org
:benchmark: false
:backtrace: false
update: --no-document --env-shebang
:update_sources: true