Skip to content

Instantly share code, notes, and snippets.

View miron's full-sized avatar
🧘‍♂️
Smashing Python for Fun and Profit

Miron miron

🧘‍♂️
Smashing Python for Fun and Profit
View GitHub Profile
@konstantinfarrell
konstantinfarrell / fizzbuzz.py
Created June 28, 2016 20:42
FizzBuzz one-liner in Python 3
# Using a lambda function
print(list(map(lambda i: "Fizz"*(i%3==0)+"Buzz"*(i%5==0) or str(i), range(1,101))))
# Using a for loop
for i in range(1, 101): print("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or str(i))
@joelverhagen
joelverhagen / README.md
Created February 12, 2012 02:14
Jekyll YouTube Embed Plugin

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@jtwyles
jtwyles / dema.py
Last active August 19, 2023 18:23
Calculate EMA(EMA) and DEMA in Python
#
# See how to use this script and what type of input to use at:
# https://steemit.com/trading/@jwyles/ema-ema-and-dema-how-to-calculate-using-python-and-spreadsheets
#
# This gist is an extension of this other gist:
# https://gist.github.com/jtwyles/517becb2deebf9e3b2874d8c26c4c99f
#
import csv
import re
@omz
omz / FileTransfer.py
Last active August 8, 2023 14:44
File Transfer script for Pythonista (iOS)
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.
@pudquick
pudquick / shellista.py
Last active November 12, 2022 16:56
Advanced shell for Pythonista
import os, cmd, sys, re, glob, os.path, shutil, zipfile, tarfile, gzip
# Credits
#
# The python code here was written by pudquick@github
#
# License
#
# This code is released under a standard MIT license.
#
@russjones
russjones / run.sh
Last active September 23, 2022 14:57
A script to demonstrate Teleport Enhanced Session Recording.
#!/bin/bash
set -euo pipefail
RELEASE="teleport-v4.2.3-linux-amd64-bin.tar.gz"
if [[ $EUID -ne 0 ]]; then
echo "--> Please run this script as root or sudo."
exit 1
fi
anonymous
anonymous / Pypi.py
Created March 26, 2013 04:46
Pypi
import urllib
import tarfile
import shutil
import console
import os
class Installer(object):
name = None
version = None
firstLetter = None
@vitobotta
vitobotta / contact-form.rb
Created April 22, 2011 21:50
A Sinatra-powered contact form for Jekyll
# See blog post at http://vitobotta.com/sinatra-contact-form-jekyll/
%w(rubygems sinatra liquid active_support/secure_random resolv open-uri pony haml).each{ |g| require g }
APP_ROOT = File.join(File.dirname(__FILE__), '..')
set :root, APP_ROOT
set :views, File.join(APP_ROOT, "_layouts")
not_found do
@ywangd
ywangd / psiclient.py
Last active April 10, 2020 16:32
Proof-of-Concept Client for Pythonista-Script-Index
"""
Basic client for Pythonista Script Index (https://github.com/ywangd/Pythonista-Script-Index)
See also: https://github.com/ywangd/psiclient
"""
import platform
import sys
import os
import urllib2
import json
@omz
omz / ImageMail.py
Created November 14, 2012 17:43
ImageMail
# Example for sending an email with an attached image using smtplib
#
# IMPORTANT: You need to enter your email login in the main() function.
# The example is prepared for GMail, but other providers
# should be possible by changing the mail server.
import smtplib
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email import encoders