Skip to content

Instantly share code, notes, and snippets.

View madneal's full-sized avatar

Neal Caffery madneal

View GitHub Profile
foreach ($i in Get-ChildItem IDS)
{
Get-Content IDS/$i | out-file -Encoding utf8 -filepath ids-utf8/$i
}
@madneal
madneal / watermark.txt
Created April 7, 2019 03:57
添加水印
composite -dissolve 50% -gravity center water.png b-out.jpg bbbb.jpg
@madneal
madneal / transparent.txt
Created April 6, 2019 02:16
convert transparent to red color
convert photo-removebg.png -background red -alpha remove -alpha off red.png
magick convert father.jpg -font abc.ttf -pointsize 48 -fill black -annotate +620+145 @demo.txt demo.png
String docsPath = "inputFiles";
String indexPath = "indexedFiles";
Path docDir = Paths.get(docsPath);
Directory dir = FSDirectory.open(Paths.get(indexPath));
Analyzer analyzer = new StandardAnalyzer();
@madneal
madneal / lucen-index-Doc
Last active August 25, 2017 03:23
lucene-test
static void indexDocs(final IndexWriter writer, Path path) throws IOException
{
//Directory?
if (Files.isDirectory(path))
{
//Iterate directory
Files.walkFileTree(path, new SimpleFileVisitor<Path>()
{
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException
magick convert icon.png -resize 16x16 icon-16.png
toolbox.precache() will add one or more URLs to a cache when the service worker is installed, but it won't take any steps to make sure that those URLs are kept up to date. So, for instance, if you call toolbox.precache(['index.html']), it will add an entry for index.html to your runtime cache when the service worker is installed, but there is nothing that will automatically update that entry when index.html changes. sw-toolbox also does not set up any routes or handlers to serve that cached response by default. It's up to you, as a developer, to set up a route that will match requests for index.html and use an appropriate handler (and hopefully not use cacheFirst, or else index.html will never be updated).
In contrast, sw-precache integrates with your build process, and takes care of detecting when any of your local assets, like index.html, have changed. When something does change, it will automatically update the cached entry for you. It will also set up routes with an appropriate handler to match requests
magick convert ecnu.png -fuzz 60% -transparent white ecnu1.png
convert 2.jpg -alpha set -channel RGBA -fuzz 10% -fill "rgb(255,0,0)" -draw "color 180,150 replace" new.png