Skip to content

Instantly share code, notes, and snippets.

View mrdaios's full-sized avatar
🐢

Xie Wu mrdaios

🐢
  • China, Chengdu
View GitHub Profile
@chuangbo
chuangbo / README.md
Last active June 19, 2023 04:48
Python dynamic DNSPod DNS Script

替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获取 API Token 的方式

获得 domain_id 可以用 curl

curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
@kylefox
kylefox / color.m
Created January 27, 2012 17:45
Generate a random color (UIColor) in Objective-C
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
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
@iamleeg
iamleeg / main.mm
Created March 24, 2012 00:23
Using operator overloading with Objective-C. Erm, ++.
#include "objc_id.hpp"
int main(int argc, const char * argv[])
{
@autoreleasepool {
NSString *s1 = @"hello";
NSString *s2 = [@"hell" stringByAppendingString: @"o"];
if ((objc_id(s1) == objc_id(s2))) {
NSLog(@"win");
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@spilliams
spilliams / SWAppDelegate.h
Created January 18, 2013 02:08
lock state notifications test
//
// SWAppDelegate.h
// lockstatenotificationstest
//
// Created by Spencer Williams on 1/17/13.
// Copyright (c) 2013 Spencer Williams. All rights reserved.
//
#import <UIKit/UIKit.h>
@mattt
mattt / uiappearance-selector.md
Last active June 4, 2024 13:28
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@bobmoff
bobmoff / UIView+RoundedCorners.h
Created July 10, 2013 15:23
Add rounded corners to any view using layer mask.
#import <UIKit/UIKit.h>
@interface UIView (RoundedCorners)
- (void)setRoundedCorners:(UIRectCorner)corners radius:(CGSize)size;
@end
@andreacremaschi
andreacremaschi / UITableView+Header
Last active June 28, 2020 04:19
UITableView category to resize table view header using autolayout
UITableView convenience classes for resizing header and footer with autolayout.
@andelf
andelf / Swift.text
Created June 20, 2014 08:51
Swift Standard Library .swiftmodule Dump
Swift
LLVM 3.5svn
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/Algorithm.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/ArrayBody.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/ArrayBuffer.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/ArrayBufferType.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/ArrayType.swift
/BinaryCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8~2/Objects/stdlib/macosx-10.9-internal-x86_64/stdlib/core/Arrays.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/Assert.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/AssertCommon.swift
@hooman
hooman / AssociatedObjects.swift
Last active May 4, 2022 07:33
Take 2.0: A completely new take on Objective-C associated types. (See history for the ancient approach)
// Playground - noun: a place where people can play
//
//
// By: Hooman Mehr (hooman@mac.com)
// Gist: https://gist.github.com/hooman/599e381d5f037b87d20b (The latest version is always here)
//
//
// Update: 07/30/2014
// Added WeaklyOwned & removeOrphans for memory management support, added more generics & basic access control.
// 08/06/2014