#Webpage Thumbnails In Python A small WSGI script that uses selenium's headless PhantomJS driver to capture webpage screenshots, and PIL to resize them. Cropping options could easily be added.
##Dependencies
- Python selenium
- Python PIL
- PhantomJS
| #!/bin/sh | |
| # dnsexit.sh - A DnsExit.com DDNS custom module for Synology DSM | |
| # | |
| # Author: | |
| # Brian Schmidt Pedersen (http://blog.briped.net) | |
| # | |
| # Version: | |
| # 1.3.5 |
#Webpage Thumbnails In Python A small WSGI script that uses selenium's headless PhantomJS driver to capture webpage screenshots, and PIL to resize them. Cropping options could easily be added.
##Dependencies
| <!-- | |
| The GenerateVersionInfo task will generate the VersionInfo.cs file with the | |
| metadata for the current build. | |
| --> | |
| <UsingTask TaskName="GenerateVersionInfo" | |
| TaskFactory="CodeTaskFactory" | |
| AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> | |
| <ParameterGroup> |
| //infix operator-precedence parser | |
| //also supports a d operator - a dice roll | |
| var parsePrecedence = (function () { | |
| //we don't care about whitespace. well, most whitespace | |
| var whitespace = { | |
| ' ' : true, | |
| '\t' : true | |
| }; |
These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).
First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.
Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.
| using System; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| using System.IO; | |
| namespace KlerksSoft | |
| { | |
| public static class TextFileEncodingDetector | |
| { | |
| /* |