Skip to content

Instantly share code, notes, and snippets.

View watter's full-sized avatar

Leslie H Watter watter

View GitHub Profile
@watter
watter / pom.xml
Created August 28, 2023 21:16
pom.xml do curso de git
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.
org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Hello</groupId>
<artifactId>helloworld</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
@watter
watter / fullname.awk
Created April 27, 2016 12:22
Awk program that separates fullname from a CSV file in firstname,middlename,lastname
BEGIN{FS=","}
{
splittedname="";
n=split($1, nome, " ");
# print n
if ( n == 2 ) {
splittedname=nome[1] FS" "FS;
} else {
splittedname=nome[1] FS;
}
@watter
watter / highlight-code-latex.org
Last active November 20, 2015 19:16
highlighting code on org-mode exporting to latex with minted package

Geração de Saída formatada no Latex

Observe que precisa de 2 itens:

  1. cabeçalho usando pacote minted (que depende do pygments e python)
  2. rodapé que acrescenta a opção -shell-escape que o minted usa para colocar o
#!/bin/bash
# como pegar a lista de municípios do Brasil formatada para o resourcespace
cd /tmp
curl -C - -L -O http://pt.wikipedia.org/wiki/Lista_de_munic%C3%ADpios_do_Brasil 2>/dev/null
cat /tmp/Lista_de_munic%C3%ADpios_do_Brasil | grep wiki | grep '<li><a' | sed -e 's/<[^>]*>//g' | grep -vi 'municípios do Brasil' | grep -v 'Toponímia' | tr '\n' ',' | sed -e 's/^/,/;s/,$//'
@watter
watter / config.php
Created May 13, 2015 14:25
resourcespace config file
<?php
###############################
## ResourceSpace
## Local Configuration Script
###############################
# All custom settings should be entered in this file.
# Options may be copied from config.default.php and configured here.
# MySQL database settings
@watter
watter / gist:31469524eeeb66222987
Created February 4, 2015 12:02
change settings on emacs latex calendar generation - t M
(add-hook 'cal-tex-hook 'my-calendar-a4)
(defun my-calendar-a4 ()
"Change inputenc from latin1 to utf8 and page layout to landscape."
(goto-char (point-min))
(while (search-forward "latin1]{inputenc}" nil t)
(replace-match "utf8]{inputenc}
\\usepackage[landscape]{geometry}" t t)))
@watter
watter / slides.org
Created February 12, 2014 18:10
configuração DHCP exemplo

default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option routers 192.168.1.1; option domain-name-servers 200.106.80.11, 200.106.1.5; option domain-name “example.com.br”; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.10 192.168.1.100; }

@watter
watter / .saveplace-emacs.el
Last active August 29, 2015 13:55
save place of cursor between emacs session
;; it just opens the place where I had the point
(require 'saveplace)
(setq-default save-place t)
@watter
watter / i-reg-data.el
Last active December 23, 2015 11:39
looking for a date /changing emacs point inside a well formated file
(defun i-reg-data (&optional tag)
"Inserts/format an account record. It should be used with moneylog
2009-08-15 -29.00 visa | Cicles Radar - Mesa para a bicicleta"
(interactive)
;; use or not org function to prefill the date
(set 'use-org "T")
;; pre-fills the today variable with today's date
(if (string= use-org "T")
(setq today (org-read-date)) ;; use org
(setq today (format-time-string "%Y-%m-%d")) ;; do not use org
@watter
watter / gist:5730830
Created June 7, 2013 17:15
moneylog helper functions
(defun mlog-almoco ()
(interactive)
(start-process "mount /media/Leslie"
(get-buffer-create "*mount-buffer*")
"/bin/mount"
"/media/Leslie")
(sleep-for 5)
(load-file "/media/Leslie/moneylog/moneylog.el")
(pop-to-buffer (find-file-noselect "/media/Leslie/moneylog/almoco.txt"))
(delete-other-windows)