Skip to content

Instantly share code, notes, and snippets.

View gugat's full-sized avatar

Gustavo Salazar gugat

  • Buk
  • Santiago - Chile
View GitHub Profile
@gugat
gugat / samba-access.sh
Last active January 11, 2024 23:46
Script to install and configure Samba in Ubuntu.
#!/bin/bash
# Description: Script to install and configure Samba in Ubuntu.
# Author: Gustavo Salazar L.
# Date: 2013-03-27
#
# How to use:
# chmod +x samba-access.sh
# ./samba-access.sh PATH_TO_SHARED_DIRECTORY PERMISSIONS
@gugat
gugat / tkinter-dataframe-table.py
Created May 8, 2017 16:44
Show Pandas dataframe as table with Tkinter
# Taken from https://github.com/dmnfarrell/pandastable/wiki/Code-Examples
from tkinter import *
from pandastable import Table, TableModel
class TestApp(Frame):
"""Basic test frame for the table"""
def __init__(self, parent=None):
self.parent = parent
Frame.__init__(self)
@gugat
gugat / devise.es.yml
Last active June 8, 2023 11:32 — forked from rrussell/devise.es.yml
Devise 4.3.0 Spanish Locale
# Traducciones adicionales en https://github.com/plataformatec/devise/wiki/I18n
es:
devise:
confirmations:
confirmed: "Tu correo electrónico ha sido confirmado exitosamente."
send_instructions: "Recibirás un email con las instrucciones para confirmar tu correo electrónico en unos minutos."
send_paranoid_instructions: "Si tu correo electrónico existe en nuestra base de datos, recibirás un email con las instrucciones para confirmar tu correo electrónico en unos minutos."
failure:
already_authenticated: "Ya iniciaste sesión."
@gugat
gugat / bioinformatics_1.py
Last active February 10, 2023 21:04
genomics
# Times Pattern is found in Text
def PatternCount(Pattern, Text):
count = 0
for i in range(len(Text)-len(Pattern)+1):
if Text[i:i+len(Pattern)] == Pattern:
count = count+1
return count
print PatternCount("AAA", "GACCATCAAAACTGATAAACTACTTAAAAATCAGT")
@gugat
gugat / conteo_votos.R
Created February 11, 2021 14:35 — forked from loreabad6/conteo_votos.R
Diferencia entre @yakuperezg y @LassoGuillermo, tweets de @angiegomeza de los resultados del CNE.
library(rtweet)
library(tidyverse)
library(lubridate)
library(gganimate)
# Extraer tweets de Andrea Gomez
reconteo = search_tweets(
q = "angiegomeza AND Actualización AND Diferencia",
include_rts = F
)
@gugat
gugat / give_me_paremeter.sh
Created September 25, 2019 13:36
How to exit if no arguments are given to the script
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo 'Give me a parameter :D'
exit 0
fi
@gugat
gugat / postman_parse_link_headers.rb
Last active September 3, 2019 20:25 — forked from thesowah/plh.rb
Parse link headers from Postman API in Ruby
require 'minitest/autorun'
require 'minitest/spec'
#:nodoc:
class TestCompensation < Minitest::Test
def setup
@compensation = Compensation.new
end
describe 'when worked less than 12 months' do
export const signIn = (email, password) => {
return (dispatch, getState) => {
return new Promise((resolve, reject) => {
return fetch(`${BASE_URL}/auth/sign_in`, {
method: 'POST',
timeout: REQUEST_TIMEOUT,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
@gugat
gugat / documents.rb
Created November 8, 2018 17:14 — forked from dhh/documents.rb
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end