Skip to content

Instantly share code, notes, and snippets.

### Based on: https://gist.github.com/b0644f5ed1d94bd32805
### This version strips unicode characters from the downloaded script
### to work around the currently limited unicode support of the editor
### module.
# This script downloads and opens a Gist from a URL in the clipboard.
# It's meant to be put in the editor's actions menu.
#
# It works with "raw" and "web" gist URLs, but not with gists that
# contain multiple files or non-Python files.
@sidewinder42
sidewinder42 / DropboxSync.py
Last active March 8, 2016 03:30 — forked from wrenoud/DropboxSync.py
A quick fix for DropboxSync to stop it crashing in Pythonista 1.4 when trying to write to Inbox by forcing it not to write to Inbox. There are probably more elegant solutions...
import os
import sys
import pickle
import console
# I moved 'dropboxlogin' into a sub folder so it doesn't clutter my main folder
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')]
import dropboxlogin # this code can be found here https://gist.github.com/4034526
STATE_FILE = '.dropbox_state'
@dhutchison
dhutchison / FileDownloader.py
Created May 6, 2014 20:39
Script for downloading a file at a URL and uploading the file to Dropbox. For use with Pythonista.
# Script for downloading a URL to Dropbox
import sys
import urllib2
import urllib
import dropbox
import os
import console
# Configuration
DOWNLOAD_FOLDER = 'downloads'
@PNergard
PNergard / Parse excel-file and generate html table
Last active November 22, 2018 15:40
A method that uses EPPlus to parse a excel-file and generate a html table. Link to EPPlus nuget page: https://www.nuget.org/packages/EPPlus/. I don't take any credit for the code since I found it on the web and have only slightly modified it. But it works and I think it's worth spreading.
private string ParseExcelFileAndGenerateHtmlTable(ExcelPackage xlPackage)
{
string html = "";
int workBooks = 0;
using (xlPackage)
{
var workbook = xlPackage.Workbook;
if (workbook != null)
{
@f-steff
f-steff / excel formulas.md
Last active June 28, 2024 08:01
Excel formulas to calculate IP values such as Netmask, IP range start, IP range end, Broadcast IP, Number of hosts.

Excel formulas to calculate IP values - Works in Excel and Google Sheet.

Updated 2023-12-11: Hosts calculation updated to support CIDR or 31 and 32.

Prerequisites:

  • A1 contains an IP address, such as 10.0.0.2
  • B1 contains the number of bits in the netmask (CIDR) such as 24

The below formulas then go into C1, D1 etc. to perform the various calculations. Some calculations depends on other calculations.