-
With a single command, skip the hassle and get your app running in the cloud effortlessly.
| // | |
| // GIF2MP4.swift | |
| // | |
| // Created by PowHu Yang on 2020/4/24. | |
| // Copyright © 2020 PowHu Yang. All rights reserved. | |
| // | |
| /* How to use | |
| let data = try! Data(contentsOf: Bundle.main.url(forResource: "gif", withExtension: "gif")!) | |
| let tempUrl = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("temp.mp4") |
| /* | |
| *** Academy Engraved LET *** | |
| AcademyEngravedLetPlain | |
| --------------------- | |
| *** Al Nile *** | |
| AlNile | |
| AlNile-Bold | |
| --------------------- | |
| *** American Typewriter *** | |
| AmericanTypewriter |
| // it returns a square thumbnail. | |
| func getAssetThumbnail(asset: PHAsset, size: CGFloat) -> UIImage { | |
| let retinaScale = UIScreen.mainScreen().scale | |
| let retinaSquare = CGSizeMake(size * retinaScale, size * retinaScale) | |
| let cropSizeLength = min(asset.pixelWidth, asset.pixelHeight) | |
| let square = CGRectMake(0, 0, CGFloat(cropSizeLength), CGFloat(cropSizeLength)) | |
| let cropRect = CGRectApplyAffineTransform(square, CGAffineTransformMakeScale(1.0/CGFloat(asset.pixelWidth), 1.0/CGFloat(asset.pixelHeight))) | |
| let manager = PHImageManager.defaultManager() |
| package main | |
| import ( | |
| "io/ioutil" | |
| "os/exec" | |
| "fmt" | |
| ) | |
| // EXAMPLE: echo "Subject: TestnHello" | sendmail -f [email protected] [email protected] | |
| // Useful Links: https://gobyexample.com/spawning-processes |
Netcat is like a swiss army knife for geeks. It can be used for just about anything involving TCP or UDP. One of its most practical uses is to transfer files. Non *nix people usually don't have SSH setup, and it is much faster to transfer stuff with netcat then setup SSH. netcat is just a single executable, and works across all platforms (Windows,Mac OS X, Linux).
On the receiving (destination) terminal, run:
nc -l -p 1234 > out.file You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.
The RecyclerView should use a LinearLayoutManager.
You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)
This is a porting of the class SimpleSectionedListAdapter provided by Google
Example:
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com, example2.com, and example1.com/images on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
| @implementation UIImage (scale) | |
| /** | |
| * Scales an image to fit within a bounds with a size governed by | |
| * the passed size. Also keeps the aspect ratio. | |
| * | |
| * Switch MIN to MAX for aspect fill instead of fit. | |
| * | |
| * @param newSize the size of the bounds the image must fit within. | |
| * @return a new scaled image. |
