Skip to content

Instantly share code, notes, and snippets.

View molon's full-sized avatar

molon molon

  • Hangzhou, China
View GitHub Profile
@molon
molon / main.go
Created September 4, 2022 18:42 — forked from hallazzang/main.go
[go] (Windows) ensure all child processes are killed when main program exits
package main
import (
"os/exec"
"unsafe"
"golang.org/x/sys/windows"
)
// We use this struct to retreive process handle(which is unexported)
@molon
molon / fastly.txt
Created December 28, 2020 06:27 — forked from denisu/fastly.txt
Fastly IPv6 Hosts
2a04:4e42::1 5742636757417984-fe1.pantheonsite.io
2a04:4e42::2 5724160613416960-fe2.pantheonsite.io
2a04:4e42::3 5746821397741568-fe3.pantheonsite.io
2a04:4e42::4 5714315743068160-fe4.pantheonsite.io
2a04:4e42::72 *.avvosites.com
2a04:4e42::74 www.aclu.org
2a04:4e42::78 *.twimg.com
2a04:4e42::79 *.wixstatic.com
2a04:4e42::80 admin.wes.bibbed.org
2a04:4e42::81 www.bbc.com
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.
@molon
molon / gist:6523ffb8d8feaf28d493
Last active August 29, 2015 14:04
capture for UIScrollView
- (UIImage*)image
{
UIImage *image = nil;
UIGraphicsBeginImageContextWithOptions(self.contentSize, NO, 0.0f);
{
CGPoint origOffset = self.contentOffset;
CGRect origFrame = self.frame;
self.frame = CGRectMake(0, 0, self.contentSize.width, self.contentSize.height);
self.contentOffset = CGPointZero;