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 / fish_install.md
Created February 16, 2023 02:44 — forked from gagarine/fish_install.md
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@alfredcc
alfredcc / StringExtensionHTML.swift
Created October 17, 2022 02:51 — forked from Sadmansamee/StringExtensionHTML.swift
Decoding HTML Entities in Swift
//
// Extension.swift
// Hadith
//
// Created by Sadman samee on 2/5/16.
// Copyright © 2016 LoopsLab. All rights reserved.
//
import Foundation
import Foundation
@alfredcc
alfredcc / NSPersistentContainer+extension.swift
Created October 7, 2022 09:48 — forked from atomicbird/NSPersistentContainer+extension.swift
Back up and restore Core Data persistent stores
//
// NSPersistentContainer+extension.swift
// CDMoveDemo
//
// Created by Tom Harrington on 5/12/20.
// Copyright © 2020 Atomic Bird LLC. All rights reserved.
//
import Foundation
import CoreData
@alfredcc
alfredcc / MyPresentationController.swift
Created August 19, 2020 10:07
MyPresentationController
import UIKit
import RxSwift
class MyPresentationController: UIPresentationController {
/** To save keyboard animation duration. */
private var _animationDuration : TimeInterval = 0.25
/** To mimic the keyboard animation */
private var _animationCurve = UIView.AnimationOptions.curveEaseOut
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.87451 0.882353 0.909804 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>CourierNewPSMT - 12.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0.87451 0.882353 0.909804 1</string>
@alfredcc
alfredcc / yep.markdown
Created January 16, 2016 06:45 — forked from kevinzhow/yep.markdown
Yep API

Yep API Reference

概述

  • 基于 HTTP
  • RESTful
  • 采用标准 HTTP Code 返回错误
  • 返回格式为 JSON
@alfredcc
alfredcc / GCD.swift
Created December 25, 2015 02:36
You can use enum and protocol extension to provide GCD convenience API:
You can use enum and protocol extension to provide GCD convenience API:
```
protocol ExcutableQueue {
var queue: dispatch_queue_t { get }
}
extension ExcutableQueue {
func execute(closure: () -> Void) {
dispatch_async(queue, closure)
}
//: Convenience functions/extension on top of GCD.
import Dispatch
var MainQueue: dispatch_queue_t { return dispatch_get_main_queue() }
func GlobalQueue(qos: dispatch_qos_class_t = .Default) -> dispatch_queue_t
{
return dispatch_get_global_queue(qos, 0)
}
//
// ImageViewerViewController.swift
// GJHP2P
//
// Created by race on 15/11/30.
// Copyright © 2015年 Guijinhui. 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