Skip to content

Instantly share code, notes, and snippets.

View SuperY's full-sized avatar
🎯
Focusing

SuperY SuperY

🎯
Focusing
View GitHub Profile
@wojtha
wojtha / gist:1852991
Created February 17, 2012 12:08
GIT: Remove tag from the remote repository
git tag -d 12345
git push origin :refs/tags/12345
/* That will remove '12345' from the remote repository. */
/* http://nathanhoad.net/how-to-delete-a-remote-git-tag */
@SuperY
SuperY / VersonContro.sh
Created April 25, 2014 13:13
Set Xcode build number by the building time
version=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $PRODUCT_SETTINGS_PATH`
version=`expr $version + 1`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $version" $PRODUCT_SETTINGS_PATH
#/usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $version\" $PRODUCT_SETTINGS_PATH 这行代码会让version也自增,一般不需要"
#From 'http://blog.csdn.net/kafeidev/article/details/8221273'
@maciekish
maciekish / UINavigationBar+CustomHeight.h
Created September 10, 2014 08:48
Custom UINavigationBar height working in iOS 7 and 8. To use, find your navigation bar reference and just setHeight:200 etc.
//
// UINavigationBar+CustomHeight.h
//
// Copyright (c) 2014 Maciej Swic
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@jonathan-beebe
jonathan-beebe / alasset_to_phasset.swift
Created July 18, 2015 16:26
Convert ALAsset to iOS8+ PHAsset
import Photos
import AVFoundation
func ALAssetToPHAsset(asset:ALAsset) -> PHAsset {
var fetchOptions: PHFetchOptions = PHFetchOptions()
var url:NSURL = asset.valueForProperty(ALAssetPropertyAssetURL) as! NSURL
let fetchResult:PHFetchResult = PHAsset.fetchAssetsWithALAssetURLs([url], options: fetchOptions)
return fetchResult.firstObject as! PHAsset
}
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active March 26, 2024 01:21
A sample README for all your GitHub projects.

Repository Title Goes Here

Frances Coronel

INSERT GRAPHIC HERE (include hyperlink in image)

Subtitle or Short Description Goes Here

ideally one sentence >

@jason5ng32
jason5ng32 / surge.conf
Last active April 7, 2024 13:04
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = PASSWORD@0.0.0.0:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
extension PHPhotoLibrary {
typealias PhotoAsset = PHAsset
typealias PhotoAlbum = PHAssetCollection
static func saveImage(image: UIImage, albumName: String, completion: (PHAsset?)->()) {
if let album = self.findAlbum(albumName) {
saveImage(image, album: album, completion: completion)
return
}
# 你可以从该 URL 下载这个配置文件: http://surge.run/config-example/ios.conf
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备
# Version 2.0
[General]
# 日志等级: warning, notify, info, verbose (默认值: notify)
loglevel = notify
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS
# 版本中,如果启用了 Set as System Proxy, 那么这些值会被写入到系统网络代理
# 设置中.)