Skip to content

Instantly share code, notes, and snippets.

View alfredcc's full-sized avatar
:octocat:
learning

race alfredcc

:octocat:
learning
View GitHub Profile
@alfredcc
alfredcc / 1pxline.swift
Last active October 19, 2015 13:43
create a 1px line with Interface Builder
@IBOutlet var hairlineConstraints: Array<NSLayoutConstraint>? {
didSet {
for hairlineConstraint in hairlineConstraints! {
hairlineConstraint.constant = 1 / UIScreen.mainScreen().scale
}
}
}
@alfredcc
alfredcc / gitignore
Created October 19, 2015 07:34
Swift.gitignore
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
@alfredcc
alfredcc / com.shadowsocks.chinadns.plist
Created October 19, 2015 13:38 — forked from lexrus/com.shadowsocks.chinadns.plist
LaunchCtl plist of ChinaDNS for El Capitan.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.shadowsocks.chinadns</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/chinadns</string>
<string>-m</string>
@alfredcc
alfredcc / UINavigationBar+Addition.m
Last active September 6, 2017 08:14
UINavigationBar Hairline
//
// UINavigationBar+Addition.m
// UINavigationBar+Addition
//
// Created by Junda on 14/3/14.
// Copyright (c) 2014 Just2us. All rights reserved.
//
#import "UINavigationBar+Addition.h"
@alfredcc
alfredcc / .travis.yml
Last active November 4, 2015 02:28
another yml temple
branches:
only:
- develop
language: objective-c
os: osx
osx_image: xcode7
cache:
- cocoapods
before_install:
pod install
@alfredcc
alfredcc / BackgroundView.swift
Last active November 2, 2015 05:54
BackgroundView
/*
* Copyright (c) 2015 Razeware LLC
*
* 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
* furnished to do so, subject to the following conditions:
*
@alfredcc
alfredcc / delay.swift
Created November 8, 2015 14:03
delay function in swift
// A delay function
func delay(seconds seconds: Double, completion:()->()) {
let popTime = dispatch_time(DISPATCH_TIME_NOW, Int64( Double(NSEC_PER_SEC) * seconds ))
dispatch_after(popTime, dispatch_get_main_queue()) {
completion()
}
}
@alfredcc
alfredcc / Badge.swift
Created November 27, 2015 03:27 — forked from yonat/Badge.swift
Rounded UILabel and UIButton, Badged UIBarButtonItem
//
// Badge.swift
// Extensions for Rounded UILabel and UIButton, Badged UIBarButtonItem.
//
// Created by Yonat Sharon on 06.04.2015.
// Copyright (c) 2015 Yonat Sharon. All rights reserved.
//
import UIKit
@alfredcc
alfredcc / LoginViewController.swift
Created November 28, 2015 15:49
A demo of how to use 'NSURLSession'
//
// LoginViewController.swift
// Authenticator
//
// Created by Kyle Jessup on 2015-11-12.
// Copyright © 2015 PerfectlySoft. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
//
// ImageViewerViewController.swift
// GJHP2P
//
// Created by race on 15/11/30.
// Copyright © 2015年 Guijinhui. All rights reserved.
//
import UIKit