Skip to content

Instantly share code, notes, and snippets.

@gpalazuelosg
gpalazuelosg / generate-ssh-key.sh
Created January 17, 2021 20:00 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@gpalazuelosg
gpalazuelosg / cloud9.md
Created March 11, 2020 07:08 — forked from jamstooks/cloud9.md
Notes on starting up an AWS Cloud9 Django dev environment with Python3

My AWS Cloud9 Setup for Python/Django and Node

Getting setup

sudo yum -y update

I'm not a big fan of their default bash prompt:

echo "export PS1='[\D{%F %T}]\n\[\e]0;\w\a\]\[\e[32m\]\u:\[\e[33m\]\w\[\e[0m\]\n\$ '" >> ~/.bashrc

source ~/.bashrc

@gpalazuelosg
gpalazuelosg / pascal_triangle.py
Created December 26, 2019 18:09
Pascal's triangle - my algorithm coded in Python
# what is Pascal's triangle?
# https://en.wikipedia.org/wiki/Pascal%27s_triangle
number_of_rows = 11
def print_triangle_row(rows:int, current_row:int):
one_line= ""
# iterate on current_line
@gpalazuelosg
gpalazuelosg / fix-jexcel.1.5.0.js
Created June 19, 2018 06:30
fix for jexcel.1.5.0.js, so ondeleterow can return proper and useful values
/**
* Delete a row by number
*
* @param integer rowNumber - row number show be excluded
* @param integer numOfRows - number of lines
* @return void
*/
deleteRow : function(rowNumber, numOfRows) {
// Id
var id = $(this).prop('id');
@gpalazuelosg
gpalazuelosg / setup.md
Created April 20, 2018 14:31 — forked from developius/README.md
Set up GitHub push with SSH keys

Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

ssh -T git@github.com
@gpalazuelosg
gpalazuelosg / git-pushing-multiple.rst
Created December 14, 2017 06:39 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@gpalazuelosg
gpalazuelosg / magic_numbers.py
Created August 1, 2016 05:18
playground - python - functions first starts
import random
magic_numbers = [random.randint(0,9), random.randint(0,9)]
#print(magic_numbers)
chances = 3
input_usernumber_message = "This is attempt {}. Enter a number between 0 and 9: "
for attempt in range(chances): # based on initial value, it can be [0,1,2]
@gpalazuelosg
gpalazuelosg / functions.py
Created August 1, 2016 05:17
playground - python - functions
import random
min_value_list = 0
max_value_list = 9
number_elements_list = 2
def initially_magic_numbers_list(min_value, max_value, number_of_elements):
return [random.randint(min_value,max_value) for how_many_elements in range(number_of_elements)]
@gpalazuelosg
gpalazuelosg / classes.py
Created August 18, 2015 04:04
initiation in classes in Python
__author__ = 'gerardo'
def gcd(m, n):
while m % n != 0:
oldm = m
oldn = n
m = oldn
n = oldm % oldn
__author__ = 'gerardo'
from random import randint
#alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
# 'v', 'w', 'x', 'y', 'z', ' ']
alphabet2 = 'abcdefghijklmnopqrstuvwxyz '
theGoalString = 'methinks it is like a weasel' # just put text you want the monkey to guess