Skip to content

Instantly share code, notes, and snippets.



Block or report user

Report or block FANWENBIN

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
powhu / GIF2MP4.swift
Last active Aug 18, 2019
Swift 3.0 GIF to MP4
View GIF2MP4.swift
// GIF2MP4.swift
// Created by PowHu Yang on 2017/1/24.
// Copyright © 2017 PowHu Yang. All rights reserved.
let data = try! Data(contentsOf: Bundle.main.url(forResource: "gif", withExtension: "gif")!)
let tempUrl = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("temp.mp4")
GIF2MP4(data: data)?.convertAndExport(to: tempUrl, completion: { })
spalladino /
Created Dec 22, 2015
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
jason5ng32 / surge.conf
Last active Sep 25, 2019
Surge Configs ( for 2.x )
View surge.conf
loglevel = notify
skip-proxy =,,,,, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun =,,
# dns-server =,,
# external-controller-access = PASSWORD@
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
onevcat / ATS.plist
Last active Jan 12, 2018
Fuck off ATS
View ATS.plist
View CentOS 7 + Nginx + MySQL5.6 + PHP5.6 (Laravel5.1) インストール nginx+php-fpmで動作確認まで.md

CentOS 7 + Nginx + MySQL5.6 + PHP5.6 (Laravel5.1) インストール nginx+php-fpmで動作確認まで


  • AWS EC2 t2.micro
  • CentOS Linux release 7.0.1406 (Core)
  • PHP 5.6.11
  • MySQL 5.6
  • Laravel Framework version 5.1.7 (LTS)
dz1984 /
Last active Oct 7, 2018
練習使用RESTful Web Servicet技術,打造一個簡單書藉管理Web應用程式。(草稿) 可以放至[OpenShift](

RESTful in Action


練習使用RESTful Web Servicet技術打造一個簡單書藉管理Web應用程式。


lexrus / HD.txt
Last active Oct 8, 2019
All WWDC 2013 Session Videos URLs in dumped with Chrome. You can download these videos **without** a Apple developer account by running the script. There is also a sample code downloader here:
View HD.txt
steipete / PSPDFUIKitMainThreadGuard.m
Last active Sep 26, 2019
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
View PSPDFUIKitMainThreadGuard.m
// Taken from the commercial iOS PDF framework
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 ( if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
View gist:4226365
// has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol *
// block typedef:
typedef void(^Block)();
typedef void(^ConditionalBlock)(BOOL);
typedef NSString*(^BlockThatReturnsString)();
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL);
// block property with typedef:
andrei512 / GIFLoader.h
Created Oct 15, 2012
GIFLoader - simple GIF support for iOS
View GIFLoader.h
// GIFLoader.h
// AnimatedGifExample
// Created by Andrei on 10/15/12.
// Copyright (c) 2012 Whatevra. All rights reserved.
#import <Foundation/Foundation.h>
You can’t perform that action at this time.