Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lf-araujo on github.
  • I am lf_araujo (https://keybase.io/lf_araujo) on keybase.
  • I have a public key ASDC617G4OLxNfss1M_U6m2IbC2CXS8kEWUOcZ5dg_yBmAo

To claim this, I am signing this object:

@lf-araujo
lf-araujo / markdown here.css
Created January 23, 2018 23:56
This is a modificatino from a markdown-here css, now with my changes.
.markdown-here-wrapper {
font-size: 14px;
line-height: 1.3em;
}
pre, code {
font-size: 13px;
font-family: Helvetica, Roboto, 'Courier New', Consolas, Inconsolata, Courier, monospace;
margin: auto 5px;
@lf-araujo
lf-araujo / 2014-08-09-flickr.md
Last active August 21, 2018 14:52
Backing Up Photos to Flickr with a Python Script

In trying to find a tool that would allow periodic synchronization of photos with Flickr, I discovered a small script. It works with a python2 written small command line software called flickrsmartsync and works pretty well. The tool can even be automated using a cron job. In what follows the steps to make this work will be presented.

The tools

We will be using two tools:

  1. flickrsmartsync and
@lf-araujo
lf-araujo / 2014-09-09-evernote.md
Last active March 30, 2019 18:47
Keeping my Evernote Notes as Local Markdown Files

Keeping Evernote Notes as Local Markdown Files

There is a very efficient way of managing your Evernote annotations, which is using everpad in Linux. However, it is neither working in Ubuntu 14.04, nor in elementary OS. Here is an alternative approach to deal with your evernotes notes.

This approach allows you to keep a local version of your notes as markdown (.md) files. This makes your notes searchable by Recoll or Zeitgeist, as well as it keeps them ready for rendering odf, docx, pdf or html files using

@lf-araujo
lf-araujo / 2014-10-10-sql.md
Last active March 31, 2019 10:38
Creating a SQL Database with Genie

This is part of a series of posts about the Genie programming language. I am updating my progress in learning the language from scratch in the hopes it will be useful for anyone also trying to get to programming in the linux/Gtk world. This exercise was taken from a similar one that was posted at Full Circle Magazine course of basic python. I tried to reproduce the same code, but now using the Genie programming language.

Creating the database

Here is a simple example of how to create a SQL database with Genie and to inject information into it. Note that the use of checked_exec is to improve the safety and speed of the data injection.

@lf-araujo
lf-araujo / 2014-11-10-cookbook.md
Last active March 31, 2019 10:38
A Cookbook Program to Interact with the SQL Database

This is part of a series of posts about the Genie programming language. I am updating my progress in learning the language from scratch in the hopes it will be useful for anyone also trying to get to programming in the linux/Gtk world. This exercise was taken from a similar one that was posted at Full Circle Magazine course of basic python. I tried to reproduce the same code, now in Genie.

Here is a simple example of how to create small interface that interacts with the cookbook.db3 created in last post.

[indent=4]
uses
    Sqlite
    Gee
@lf-araujo
lf-araujo / 2014-12-10-loops.Rmd
Created August 21, 2018 17:27
Data Flow with While Statements and Loops
*This is part of a series of posts about the Genie programming language. I am updating my progress in learning the language from scratch in the hopes it will be useful for anyone also trying to get to programming in the linux/Gtk world. This is an extremely basic overview of how loops look like in Genie. If you have any experience with other languages, there will be nothing new to you.*
Here is a for loop that will print a series of numbers and report that it is finished:
```
[indent=4]
init
for var I = 1 to 10
print I.to_string()
print("All done!")
@lf-araujo
lf-araujo / 2015-03-10-Exploring-the-Genie-programming-language.Rmd
Created August 21, 2018 17:32
Differences between Genie, Vala and Python
*This is part of a series of posts about the Genie programming language. I am updating my progress in learning the language from scratch in the hopes it will be useful for anyone also trying to get to programming in the linux/Gtk world.*
The main scientific programming languages are R and Python. These, however, are slow languages for general development. Recently I found out about Vala and it's python-like sister language Genie. It is a joy to learn and to use. Below I make a few comparisons between Python, Vala and Genie.
Vala seems to have a syntax similar to Java and C#, which are popular languages. Taking from the number of questions in StackExchange, I suppose it is becoming itself very popular for this reason. It is translated to C code trough the vala compiler and from C code to the binaries. That means Vala is a simpler syntax for C, which comes with all the advantages of that known, widely used, reliable language. The fun finding comes now. Their authors (not sure if the very same people, but a Gn
*This is part of a series of posts about the Genie programming language. I am updating my progress in learning the language from scratch in the hopes it will be useful for anyone also trying to get to programming in the linux/Gtk world.*
Wonder how a Gtk window would look like in Genie? Here is a simple example:
```
/* GTK+ Genie Sample Code - compile with valac --pkg gtk+-2.0 hello-gtk.gs */
uses
Gtk
init
@lf-araujo
lf-araujo / 2015-11-2-gtk-containers.Rmd
Created August 21, 2018 17:34
Gtk Containers with Notebooks and Buttons
*This is part of a series of posts about the Genie programming language. I am updating my progress in learning the language from scratch in the hopes it will be useful for anyone also trying to get to programming in the linux/Gtk world.*
Let's now move on to more complex Gtk designs. These are not necessarily useful, but serve as good example on how to code them. Here is an example of how to design the window by using grids. The next posting will be about containers using boxes.
```vala
[indent=4]
uses Gtk
class TestWindow : Window