Skip to content

Instantly share code, notes, and snippets.

View fercreek's full-sized avatar
😎
Coding coding coding

Fernando Contreras fercreek

😎
Coding coding coding
View GitHub Profile
require 'openai'
# Comprueba si se proporciona un argumento de mensaje y, en caso contrario, solicita al usuario que proporcione uno.
if ARGV.empty?
puts "Please specify a message to send to the chatbot as an argument"
exit
end
# Combina los argumentos proporcionados en un único mensaje.
message = ARGV.join(" ")
#!/usr/bin/env bash
# input: file or folder
# output: file with .bak ext or folder tar.gz ext
main(){
input=${1}
if [[ -f ${input} ]]; then
# copy file
@fercreek
fercreek / eurotrip.csv
Last active June 17, 2018 23:29
Eurotrip cost- Part 1
Destino Costo Compañia
Londres €30.59 Vueling
Brujas €20.49 National Express
Bruselas €14.70 BIC
Luxemburgo €15.90 Flixbus
Frankfurt €21.50 Flixbus
Praga €25.00 Flixbus
$(function(){
var hash = window.location.hash;
hash && $('ul.nav a[href="' + hash + '"]').tab('show');
$('.nav-tabs a').click(function (e) {
$(this).tab('show');
var scrollmem = $('body').scrollTop();
window.location.hash = this.hash;
$('html,body').scrollTop(scrollmem);
});
@fercreek
fercreek / geckodriver-install.sh
Created May 16, 2018 20:52 — forked from cgoldberg/geckodriver-install.sh
download and install latest geckodriver for linux or mac (selenium webdriver)
#!/bin/bash
# download and install latest geckodriver for linux or mac.
# required for selenium to drive a firefox browser.
install_dir="/usr/local/bin"
json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest)
if [[ $(uname) == "Darwin" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos"))')
elif [[ $(uname) == "Linux" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')

Keybase proof

I hereby claim:

  • I am fercreek on github.
  • I am fercreek (https://keybase.io/fercreek) on keybase.
  • I have a public key ASCF38-JycSdYOlQSC69estGRE1bpmelkV3U_V_McTs5aAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am fercreek on github.
  • I am fercreek (https://keybase.io/fercreek) on keybase.
  • I have a public key ASCF38-JycSdYOlQSC69estGRE1bpmelkV3U_V_McTs5aAo

To claim this, I am signing this object:

@fercreek
fercreek / README-Template.md
Created March 23, 2017 16:58 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@fercreek
fercreek / file.controller.js
Created October 12, 2016 06:24
Update multiple files from AngularJs
angular.module('starter.controllers', [])
.controller('TestCtrl', TestCtrl);
TestCtrl.$inject = ['updateService'];
function TestCtrl(updateService){
var vm = this;
vm.addImage = addImage;
vm.data = {};
function addImage() {
const fs = require('fs')
const highland = require('highland')
highland(fs.createReadStream('customers.csv', 'utf8'))
.split()
.map(line => line.split(','))
.map(parts => ({
name: parts[0],
numPurchases: parts[1]
}))