Skip to content

Instantly share code, notes, and snippets.

@Chihpin
Chihpin / CMFWallpaper.m
Created December 4, 2018 13:01 — forked from camdenfullmer/CMFWallpaper.m
Set the wallpaper (lock and/or home screen) on iOS using Apple's private API. Please be aware that including this code in an App Store submission will result in a rejection. This has only been tested on iOS 9.2.
@implementation CMFWallpaper
+ (void)setImage:(UIImage *)image {
NSAssert([PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusAuthorized, @"access to photos is needed to set the wallpaper");
NSString *path;
#if TARGET_OS_SIMULATOR
path = @"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibrary.framework";
#else
path = @"/System/Library/PrivateFrameworks/PhotoLibrary.framework";
@Chihpin
Chihpin / .bashrc
Created July 13, 2018 09:05 — forked from patik/.bashrc
Bash configure proxy for corporate network
# configure proxy for git while on corporate network
# From https://gist.github.com/garystafford/8196920
function proxy_on(){
# assumes $USERDOMAIN, $USERNAME, $USERDNSDOMAIN
# are existing Windows system-level environment variables
# assumes $PASSWORD, $PROXY_SERVER, $PROXY_PORT
# are existing Windows current user-level environment variables (your user)
# environment variables are UPPERCASE even in git bash
@Chihpin
Chihpin / itms-service.html
Last active January 4, 2017 07:01
itms-service
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>安装APPNAME</title>
</head>
<body>
<br>
<br>
@Chihpin
Chihpin / docker.service
Created May 31, 2016 08:36 — forked from emmanuel/docker.service
Clean & simple way to override Docker launch options in CoreOS
.include /usr/lib/systemd/system/docker.service
[Service]
ExecStart=
ExecStart=/usr/bin/docker -d -s=btrfs -r=false -H fd:// --dns=172.17.42.1 --dns-search=cluster.local