Skip to content

Instantly share code, notes, and snippets.

View cosme12's full-sized avatar
🐍
Working from home

Diego Lanciotti cosme12

🐍
Working from home
  • Argentina
View GitHub Profile

How to install Lua and LuaJIT on 64-bit Windows

  1. Download the latest Lua and LuaJIT sources

    • Create temporary folder for Lua sources.
      I assume you would use C:\Temp\ folder.

    • Visit Lua FTP webpage and download the latest Lua source archive, currently it is lua-5.4.3.tar.gz

  • Use suitable software (7-Zip, WinRar, WinZip or TotalCommander) to unpack the archive.
<!-- Email Form -->
<script>
$(document).ready(function() {
//Save references to elements. Don't do DOM walks in event handlers when not needed.
var $sendEmailEl = $('#send-email');
var $subjectEl = $('#form-subject');
var $bodyEl = $('#form-message');
function updateEmailLink() {
$sendEmailEl.attr('href', 'mailto:contact@zane.sh?' +
'subject=' + encodeURIComponent($subjectEl.val()) +
@cosme12
cosme12 / ejemplo_api.py
Created August 31, 2018 17:51
Ejemplo de como usar Requests
import requests
r = requests.get('https://api.opendota.com/api/heroes')
# Con esto obtenemos todos los datos de la pagina
print(r.text)
# Ahora tenemos que usar json para parsear los datos. Porque sino tenes un string mega gigante
import json
# Transformamos todo el muro de texto en un diccionario
heroes_dict = json.loads(r.text)
@cosme12
cosme12 / snakecoin-server-full-code.py
Created January 13, 2018 18:09 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
@cosme12
cosme12 / ShortIntroToScraping.rst
Last active January 5, 2018 03:31 — forked from bradmontgomery/ShortIntroToScraping.rst
Really short intro to scraping with Beautiful Soup and Requests
#For a more advanced example look here: http://copitosystem.com/courses/dice-simulator-course/
import random
while True:
rolled = random.randint(1,6)
print("The dice rolled and you got: ", rolled)
input("Press enter key to roll again.")
x = 64
y = 64
function _update()
if (btn(0)) then x=x-1 end
if (btn(1)) then x=x+1 end
if (btn(2)) then y=y-1 end
if (btn(3)) then y=y+1 end
end
@cosme12
cosme12 / heatmap_example.py
Last active July 24, 2016 19:59 — forked from teechap/heatmap_example.py
How to make a heatmap from data stored in Python lists
'''
Most heatmap tutorials I found online use pyplot.pcolormesh with random sets of
data from Numpy; I just needed to plot x, y, z values stored in lists--without
all the Numpy mumbo jumbo. Here I have code to plot intensity on a 2D array, and
I only use Numpy where I need to (pcolormesh expects Numpy arrays as inputs).
'''
import matplotlib.pyplot as plt
import numpy as np
#here's our data to plot, all normal Python lists
<?php
/*
################################################
FECHA: 22/2/2016
CREADO POR: COSME-FULANITOS
AQUI ESTOY KIO4.COM
CONFIGURACION:
- enviar las coordenadas con el siguiente formato: -0.27907,-78.48124
EJEMPLO:
- http://kio4.com/ubicacion.php?coords=-0.27907,-78.48124
@cosme12
cosme12 / index.php
Last active January 15, 2016 18:42
<?php
/*
################################################
FECHA: 15/1/2016
CREADO POR: COSME-FULANITOS Y KADARYAN
SISTEMA BASICO DE SHOUTS DE TARINGA
CONFIGURACION:
- crear un archivo de texto en el mismo directorio que se llame "historial.txt"
NOTA: