Skip to content

Instantly share code, notes, and snippets.

@adeleinr
adeleinr / Python Cheatsheet
Last active May 5, 2024 10:39
Python Cheetcheat
SORTING
=======
Returns a sorted list => sorted(l)
Sort in place ==> l.sort([2,3,7])
# Reverse sorting by y in an (x,y) tuple list in
sorted([(1,2),(2,3)], key=lambda tup: tup[0],reverse=True))
sample = [('Jack', 76), ('Beneth', 78), ('Cirus', 77), ('Faiz', 79)]
sample.sort(key=lambda a: a[1])
@adeleinr
adeleinr / Principles for building a great engineering culture
Last active July 27, 2023 20:09
Engineering Team and Management Principles
Principles for building a great engineering team culture by Adelein Ro
=======================================================================
0) The first line of code you should write for any feature is "What are we building, why are we building it, and why now?",
Eg start with a Tech design or a Spike
1) Dig deep and wide into the functional and non functional requirements of what you are building, disambiguate with product
or stakeholders, spell out what they have not been able to. Spill out details as part of tech design, get agreement
from product and stakeholders.
2) Engineers need to be able to find indirect or direct mentors, people they can learn best tech and
people practices from on a day to day basis.
3) Need challenging work that is transferable outside the company.
@adeleinr
adeleinr / gist:fe8728939664b9ff528c2f7952491145
Last active February 22, 2023 21:20
Entrepreneurship Principles
Working backwards
=================
Used Amazon among others, before creating a new feature or product create a press release for it. Iterate until it is well "Adopted" by the internal team.
Heading: Name the product in a way the reader (i.e., your target customers) will understand.
Subheading: Describe who the market for the product is and what benefit they get. One sentence only underneath the title.
Summary: Give a summary of the product and the benefit. Assume the reader will not read anything else so make this paragraph good.
@adeleinr
adeleinr / Apache cheatsheet
Created November 3, 2011 18:10
Apache cheatsheet
MULTIPLE PORTS IN ONE HOST
---------------------------
Syntax:
Port [port]
NameVirtualHost *:[another_port]
Listen [another_port]
@adeleinr
adeleinr / git_most_used_flows.txt
Last active December 18, 2020 16:27
Git - What I use every day
Flow 1 - Get ready to work on a repo
- Clone the repo you want to work on, you can get the repo name from the "Clone or download" green button in github
git clone git@github.com:globality-corp/euclides.git
- Checkout a shared branch from the repo, in this case "develop" is the branch. You can get the branch name from "branch" dropdown menu in github
git checkout develop
- Create a private branch to work on. You will merge this branch to develop when you are done with your work and it is reviewed.
git checkout -b feauture/your-branch-name
@adeleinr
adeleinr / fabric.py
Created April 20, 2011 21:21
fabric config for deploying a Django project
"""
Distributor ID: Ubuntu
Description: Ubuntu 10.04 LTS
Release: 10.04
Codename: lucid
Author: Adelein Rodriguez, adeleinr@gmail.com
Note: This is an adaptation from a fabric script presented here:
http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p.html
Summary: This script:
Some content from http://www.thegeekstuff.com/2009/04/15-practical-postgresql-database-adminstration-commands/
1. How to change PostgreSQL root user password ?
$ /usr/local/pgsql/bin/psql postgres postgres
Password: (oldpassword)
# ALTER USER postgres WITH PASSWORD 'tmppassword';
$ /usr/local/pgsql/bin/psql postgres postgres
Password: (tmppassword)
@adeleinr
adeleinr / Git Cheatsheet
Last active February 19, 2019 04:10 — forked from hofmannsven/README.md
Using Git
===============
Global Settings
-----------
Setup autocomplete tools: brew install git bash-completion
Then add this to ~/.bash_profile :
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
@adeleinr
adeleinr / PyCharm Tricks
Last active March 26, 2018 20:52
Things I use everything on pycharm
Select enterie cols to edit
===========================
Press Ctrl+Shift+A (Find Action feature) and type column. The first result is Column Selection Mode Alt+Shift+Insert
Search and Replace All
=======================
Command + R
Search
======
@adeleinr
adeleinr / Vim Cheatsheet
Created April 16, 2010 05:45
Vim Cheatsheet
general
/ Finds a word forwards
? Finds a word backwards
Shift + g Goes to end of file
Shift + m Goes to Middle of screen
Shift + h Goes to the Top of the screen
Shift + l Goes to Bottom of the screen
. Repeat last command
:f Displays line and file name