This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -eq 0 ]] ; then | |
echo 'Give me a parameter :D' | |
exit 0 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rest_client' | |
class parse_link_headers | |
def self.parse_link_header(url, params={}) | |
response = RestClient.get url, params | |
links = Hash.new | |
parts = response.headers[:link].split(',') | |
# Parse each part into a named link | |
parts.each do |part, index| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |
NewerOlder