Skip to content

Instantly share code, notes, and snippets.

View afr-dt's full-sized avatar
:octocat:

Alejandro Flores afr-dt

:octocat:
  • Personal
  • Mexico City
View GitHub Profile
@afr-dt
afr-dt / Tabla multiplicar en Python
Created May 8, 2015 06:04
Tabla de multiplicar en Python
num = int(input("Número a multiplicar"))
rango = range(1,11)
for element in rango:
product = num * element
print (num, '*', element, "=", product)
@afr-dt
afr-dt / Calculadora Basica en Js
Created May 8, 2015 06:10
Calculadora básica en JS
<!DOCTYPE html>
<html lang="es-MX">
<head>
<meta charset = 'utf-8'>
<title>Calcu</title>
</head>
<body>
<center>
<script>
var operation;
@afr-dt
afr-dt / Table.rb
Created December 8, 2015 04:04
Tabla multiplicar Ruby
puts "Ingrese el número a multiplicar"
number = gets
number = number.to_i
for i in(1..10)
mul = i * number
puts "#{number} * #{i} = #{mul}"
end
@afr-dt
afr-dt / app.js
Last active March 16, 2017 23:28
/*
* Method ajax for canal and medio
*/
$('#hospital_id').change(function(){
var data = "";
var url = $(this).data('url');
var params = 'hospital_id=' + $('#hospital_id').val();
$.ajax({
type : "GET",
url : url,
@afr-dt
afr-dt / web-servers.md
Created May 17, 2017 09:53 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
u=User.where(:email => 'usermail@gmail.com').first
u.password='userpassword'
u.password_confirmation='userpassword'
u.save!
@afr-dt
afr-dt / reset.py
Created July 26, 2017 07:00
Reset Django admin Password
./manage.py changepassword <user_name>
# Se crean los gemsts
rvm gemset create ror5 ror4
# Se usa el gemset creado
rvm gemset use ruby-2.4.1@ror5 o ror4
# Se utilizará la misma versión de Ruby con Rails 4 o Rails 5
gem install rails o gem install rails --version=4.2.6
# Listar gemsets para ruby 2.4.1
rvm gemset list
@afr-dt
afr-dt / git-deployment.md
Created March 21, 2018 15:35 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@afr-dt
afr-dt / removeCommas.js
Created April 23, 2018 22:15
Remove commas with js from strings
str = '1,737,761.64'
str.replace(/,\s?/g, "")
OR
str.split(",").join("")