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-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
@lf-araujo
lf-araujo / 2015-11-3-gtk-boxes.Rmd
Created August 21, 2018 17:36
Designing the Window with Boxes
*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 improved design than the previous exercise. The objective is very similar, but now with boxes to hold the structure of the window.
```vala
/* Compile with: valac --pkg gtk+-3.0*/
[indent=4]
uses Gtk
@lf-araujo
lf-araujo / 2015-12-21-How-to-sync-your-documents-with-google-docs-in-Ubuntu.Rmd
Created August 21, 2018 17:36
How to Sync Your Documents with Google Docs in Ubuntu
Here is an example of how to have your documents periodically synced to google docs. We will be using two Unix tools: [ grive ](https://github.com/Grive/grive) and [ cron ](http://en.wikipedia.org/wiki/Cron).
## Installing grive
You can install grive simply by calling:
```bash
sudo apt-get install grive
```
@lf-araujo
lf-araujo / 2016-02-21-Review-progress.Rmd
Created August 21, 2018 17:38
Reviewing My Progress 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.*
## Regular expressions made easy
Some time ago I came across a Python class that was designed to make [regular expressions]( https://en.wikipedia.org/wiki/Regular_expression) easier for [beginners]( https://www.reddit.com/r/Python/comments/3zpgj1/pythonverbalexpressions_regular_expressions_made ). It essentially makes this easily to type but baffling code:
```
^https?://(?:www\\.)?[^\s]$