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
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active May 3, 2024 11:43
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active April 30, 2024 14:54
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.

@Egor-Skriptunoff
Egor-Skriptunoff / how_to_install_lua_and_luajit_on_windows.md
Last active April 26, 2024 11:44
How to install Lua and LuaJIT on Windows

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.
@miguelgrinberg
miguelgrinberg / rest-server.py
Last active March 29, 2024 09:05
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@frankyxhl
frankyxhl / zoho_send_email.py
Last active March 24, 2024 23:45
Python script to send email by zoho.com's mail service
# Code from best solution in page below:
# https://help.zoho.com/portal/community/topic/zoho-mail-servers-reject-python-smtp-module-communications
import smtplib
from email.mime.text import MIMEText
from email.header import Header
from email.utils import formataddr
# Define to/from
sender = 'sender@example.com'
@aunyks
aunyks / snakecoin-server-full-code.py
Last active March 8, 2024 19:22
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:
@jfstenuit
jfstenuit / Installing_linux_on_Baytrail_tablet.md
Last active March 6, 2024 13:13
Installing Linux on a Baytrail tablet

Hardware specs

Chinese Brand "ITworks" , Model TW891, distributed in France and Belgium by Darty

  • CPU: Intel(R) Atom(TM) CPU Z3735F @ 1.33GHz
  • Video: Intel® HD Graphics for Intel Atom® Processor Z3700 Series
  • Screen: 1280x800
  • WiFi + BT: Realtek RTL8723BS_BT
  • Disks: mmcblk1: mmc1:0001 DF4032 29.1 GiB
  • RAM: 2GB DDR3 @ 1333 MHz
@chriskiehl
chriskiehl / Vitual keystroke example
Created June 10, 2012 15:08
Python win32api simple Vitual keystroke example
#Giant dictonary to hold key name and VK value
VK_CODE = {'backspace':0x08,
'tab':0x09,
'clear':0x0C,
'enter':0x0D,
'shift':0x10,
'ctrl':0x11,
'alt':0x12,
'pause':0x13,
'caps_lock':0x14,
@ctokheim
ctokheim / cython_tricks.md
Last active March 4, 2024 23:27
cython tricks

Cython

Cython has two major benefits:

  1. Making python code faster, particularly things that can't be done in scipy/numpy
  2. Wrapping/interfacing with C/C++ code

Cython gains most of it's benefit from statically typing arguments. However, statically typing is not required, in fact, regular python code is valid cython (but don't expect much of a speed up). By incrementally adding more type information, the code can speed up by several factors. This gist just provides a very basic usage of cython.

@MalphasWats
MalphasWats / flask_ajax.py
Created July 2, 2012 08:15
Making a basic AJAX request with Flask
# Answer to a question on Flask mailing list
# http://librelist.com/browser//flask/2012/6/30/using-ajax-with-flask/
# NOTE: *REALLY* don't do the thing with putting the HTML in a global
# variable like I have, I just wanted to keep everything in one
# file for the sake of completeness of answer.
# It's generally a very bad way to do things :)
#
from flask import (Flask, request, jsonify)
app = Flask(__name__)