Skip to content

Instantly share code, notes, and snippets.

💭
In my restless dreams, I see that town.

Sergio Tapia sergiotapia

💭
In my restless dreams, I see that town.
Block or report user

Report or block sergiotapia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sergiotapia
sergiotapia / md5-example.go
Last active Oct 22, 2019
Golang - How to hash a string using MD5.
View md5-example.go
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}
@sergiotapia
sergiotapia / images_dimensions.go
Last active Oct 7, 2019
Golang - Getting the dimensions of an image. jpg, jpeg, png
View images_dimensions.go
package main
import (
"fmt"
"image"
"os"
_ "image/jpeg"
_ "image/png"
)
@sergiotapia
sergiotapia / Munich-NO2.md
Created Aug 24, 2017
NO2 in Munich, 2016
View Munich-NO2.md

NO2 in Munich 2016: high traffic => high NO2

2016-mu5-hours-junedec-23aug

This plot shows NO2 levels over the day in Munich in June and December 2016. München-Landshuter-Allee on the left has about the highest NO2 levels in all Germany, and a lot of traffic — 120,000 to 150,000 cars and light trucks per day.
Surprise: high traffic => high NO2.

@sergiotapia
sergiotapia / go-fizzbuzz.go
Last active Dec 30, 2015
FizzBuzz written using Golang!
View go-fizzbuzz.go
package main
import "fmt"
func main() {
i := 1
for i <= 100 {
if (i % 3 == 0 && i % 5 == 0) {
fmt.Println("Fizzbuzz")
} else if (i % 3 == 0) {
View gist:6991744
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.0'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'jbuilder', '~> 1.2'
View gist:6991960
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: postgresql
encoding: unicode
host: localhost
database: smitecamp_db
View gist:5770340
rails _3.2.13_ new smitecamp
bundle install
rails g scaffold champion name:string title:string hp:integer release_date:date
rake db:migrate
View gist:5360855
int cantidadTotalDePanes = 20;
int panesPorCliente = 3;
while (cantidadTotalDePanes > 0) {
if (cantidadTotalDePanes > panesPorCliente) {
Console.WriteLine("Entrego a cliente " + panesPorCliente + " panes.");
cantidadTotalDePanes -= panesPorCliente;
} else {
// Ya no tiene suficientes panes.
}
@sergiotapia
sergiotapia / gist:5216735
Created Mar 21, 2013
Documentacion: Plugin - "Dialogue"
View gist:5216735
Nombre de Plugin: **dialogue**
URL: [https://moodle.org/plugins/view.php?plugin=mod_dialogue](https://moodle.org/plugins/view.php?plugin=mod_dialogue)
Documentacion de Plugin Oficial: [http://docs.moodle.org/dev/Dialogue_2.0_specificatino](http://docs.moodle.org/dev/Dialogue_2.0_specificatino)
===========================================================================================
#Base de Datos
View gist:5216740
You can’t perform that action at this time.