Skip to content

Instantly share code, notes, and snippets.

View DmitrySandalov's full-sized avatar

Dmitry Sandalov DmitrySandalov

View GitHub Profile
@DmitrySandalov
DmitrySandalov / wget-files-cyrillic-friendly.sh
Created July 16, 2013 08:38
Download all files from website using wget (+encoding)
#!/bin/zsh
wget -m -p -E -k -K -np --restrict-file-names=nocontrol http://site/path/
@DmitrySandalov
DmitrySandalov / check_all_checkboxes.js
Created January 18, 2013 18:31
JavaScript Check All Checkboxes
function check_all_in_document(doc)
{
var c = new Array();
c = doc.getElementsByTagName('input');
for (var i = 0; i < c.length; i++)
{
if (c[i].type == 'checkbox')
{
c[i].checked = true;
}
@DmitrySandalov
DmitrySandalov / unshorten.py
Created December 19, 2012 13:02
unshorten links in file with Python
#!/usr/bin/env python
# This is for Py2k. For Py3k, use http.client and urllib.parse instead, and
# use // instead of / for the division
import sys
import httplib
import urlparse
import re
def unshorten_url(url):