jonaspf

23 thoughts; 3 streams
last posted Feb. 5, 2016, 10:37 a.m.
1
Joined on Sept. 11, 2015, 9:44 a.m.
get recent cards as: atom

Cool tip: When typing in a command in a urxvt you can press shift + mouse click anywhere on the current line to move the cursor.

Very useful when fixing a typo in a long command.

12 thoughts
updated Feb. 5, 2016, 10:37 a.m.

“If you don’t make experiments before starting a project, then your whole project will be an experiment.” - Mike Williams (Creator of Erlang)

7 thoughts
updated Jan. 27, 2016, 10:36 a.m.

Reminder to myself:

  • Have written task descriptions - People seem to forget a lot of things
  • If you want to verify if something works/is done don't just ask verbally but test it yourself or get someone to demo it to you
4 thoughts
updated Dec. 2, 2015, 4:41 p.m.
7 thoughts
updated Jan. 27, 2016, 10:36 a.m.
12 thoughts
updated Feb. 5, 2016, 10:37 a.m.
4 thoughts
updated Dec. 2, 2015, 4:41 p.m.

Streams by this user that have been favorited by others.

No favorited streams yet.

0

Cool tip: When typing in a command in a urxvt you can press shift + mouse click anywhere on the current line to move the cursor.

Very useful when fixing a typo in a long command.

0

“If you don’t make experiments before starting a project, then your whole project will be an experiment.” - Mike Williams (Creator of Erlang)

0

Multiple architectures on Ubuntu

List current main architecture:

> dpkg --print-architecture
amd64

List other architectures that are allowed on this system:

> dpkg --print-foreign-architectures
i386

Modify non-main architectures:

sudo dpkg --add-architecture test
sudo dpkg --remove-architecture test

Specifying the architecture when installing packages:

sudo apt-get install libsdl-image1.2:i386

Foreign architectures will be installed in separate directories. E.g.: /usr/lib/i386-linux-gnu/.

Show all packages with a foreign architecture:

dpkg -l | grep :i386

More info: https://wiki.debian.org/Multiarch/HOWTO

0

Reminder to myself:

  • Have written task descriptions - People seem to forget a lot of things
  • If you want to verify if something works/is done don't just ask verbally but test it yourself or get someone to demo it to you
0

Testing XPath in Firefox:

  1. Press F12 to open the developer tools
  2. Got to 'Console'
  3. Type in something like: $x("//div[@class='switcher_bar']//button")
0

I use the term projects for everything from adding a feature to an existing project as a single developer to big greenfield projects.

0

To copy files to the home directory using scp you can use the shortcut ./

scp file.zip  user1@123.123.123.123:./
0

How to copy a vagrant image to another machine

Copy the ssh key from ~/.vagrant.d/insecure_private_key and append it to the same file on the other machine to be able to log into the machine later.

Next:

vagrant package --base vm-name --output /path/to/mybox.box

Copy file to other machine. Then do:

vagrant init vm-name /path/to/mybox.box
vagrant up

Source: http://stackoverflow.com/questions/19094024/is-there-any-way-to-clone-a-vagrant-box-that-is-already-installed

0

SSL

Get information about a SSL certificate:

openssl x509 -in test.crt -text -noout
0

Mysql

 select * from token\G

instead of

 select * from token;

will display the the columns as rows below each record. This can avoid line breaks in the output and make it easier to read.

0

It is very hard to change the data structures in functional languages because of the ripple effect.

I.e.

def a(data):
  b(data)
  c(data)

Change data would mean changing three functions.

0

Taken from: http://stackoverflow.com/questions/4565325/too-many-arguments-for-function

Ways to address too many arguments:

  • Group things (ParameterObject, NamedTuple, ...) - Though that just moves the complexity but it might make things more readable (i.e. rectangle instead of x, y, w, h)
  • Use default values for optional values
  • Split into multiple functions
0

Benefits of using pure functions:

  • Portable (because it has a clear interface and boundaries)
  • Testable (just need to test what goes in and what comes out)
  • Easier to reason about (because of clear boundaries)
  • Thread safe
  • Easy to cache (https://en.wikipedia.org/wiki/Memoization)
0

When trying to incorporate some ideas of functional programming into my Python code, I tend to end up with lots of parameters in my functions.

Some questions to myself:

Some resources:

0

Don't have a 'common' library!

I've seen this in a lot of bigger code bases. There are multiple projects that share functionality. For example a solution with web and cli interface. Typically this shared functionality gets shoved into a library called 'common'. It does sound like a good idea at first but it can get very messy after a while.

Here is the problem: Programmers are lazy and creating a new library is painful. So everything that is or just seems to be shared functionality will end up in the 'common' library. After a while this library will be big and bloated and probably will have lots of dependencies on its own.

Let's imagine you need to implement a new client, say for Android. This new client needs only some of the functionality of 'common'. This means including 'common' and all of it's dependencies. More code means more bugs and more things that can go wrong.

A better approach is to have multiple smaller libraries with a defined very specific scope. That way it is easier to reuse only small parts of the overall functionality. As for the pain of creating new libraries: This can be automated to a degree.

Bottom line: Keep things small and simple for best re-usability!

0

Just a quick one because I need this all the time but I keep forgetting it: How to append the current date to a filename.

touch abcd_`date +%F`
ls abcd*
> abcd_2015-09-17

or if you are using fish:

touch abcd_(date +%F)
0

JSON hard to read? Try beautifying it with:

python -m json.tool multiproject.json

Note: This also seems to validate the JSON.

0

Just learned about pkill. pkill allows to send signals to processes by specifiying the process name:

pkill -9 firefox

Here I am feeling dump that I used things like this for the last couple of years:

 ps ax | grep firefox | awk '{print $2}' | xargs kill -9
jtauber favorited jonaspf
8 years, 7 months ago
0

Kill multiple processes with htop:

  • Press F4 and filter for the processes
  • For each process press Space to mark it
  • Press F9 and select a signal to kill all marked processes
0

To make an alias with fish shell create a new function. Avoid recursion by using the command command:

function ls
    command ls -l
end
0

Selecting and killing a process in htop can be difficult because the order of the processes constantly shift. Press F to let the cursor follow the currently selected process.

8 years, 7 months ago
0

Important documents I need to keep for every project:

  • Project log to track actions/decisions and general information
  • Current and historic KPIs for the project (more on this later)
  • List of problems and external factors that impact the project
  • List of stakeholders with email addresses and role
0

People seem to forget what has been decided even a few weeks or days ago. So I decided to start capturing every decision.

After reading http://pm.stackexchange.com/questions/1430/how-should-a-project-manager-capture-decisions I came up with the following plan:

  • Create a project log (I use Zim for note taking) for every project
  • Capture every meeting, important mails or other events in the project log
  • Put the date and the participants in the title
  • Using bullet points and indentation (outliner style) to organize the content seems to work fine
  • Mark every actions with [Action: Name] and every decision with [Decision]
  • Below [Decision] note rationale and alternative solutions
  • Some decisions are based on assumptions. If that's the case it must be stated below [Decision]

Thoughts by this user that have been liked by others.

No liked thoughts yet.