Skip to content

Instantly share code, notes, and snippets.

@kongondo
kongondo / remote-file-copy.php
Created Jan 14, 2016
Remote file copying with progress reporting in PHP.
View remote-file-copy.php
<?php
/*
* Remote File Copy PHP Script 2.0.0
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
@ruario
ruario / latest-firefox.sh
Last active Sep 28, 2021
This script will find the latest Firefox binary package, download it and repackage it into Slackware format.
View latest-firefox.sh
#!/bin/bash
# latest-firefox Version 1.6.3
# Contributer: drgibbon (thanks!)
# This script will find the latest Firefox binary package, download it
# and repackage it into Slackware format.
# I don't use Firefox for regular browsing but it is handy for
# comparative tests against Vivaldi. :P
@simonw
simonw / gist:104413
Created Apr 30, 2009
Turn a BeautifulSoup form in to a dict of fields and default values - useful for screen scraping forms and then resubmitting them
View gist:104413
def extract_form_fields(self, soup):
"Turn a BeautifulSoup form in to a dict of fields and default values"
fields = {}
for input in soup.findAll('input'):
# ignore submit/image with no name attribute
if input['type'] in ('submit', 'image') and not input.has_key('name'):
continue
# single element nome/value fields
if input['type'] in ('text', 'hidden', 'password', 'submit', 'image'):