Skip to content

Instantly share code, notes, and snippets.

Focusing Github API

CodeEagle CodeEagle

Focusing Github API
View GitHub Profile
CodeEagle / icnsutil
Created March 20, 2019 00:38
Create Icns from image file with shell script
View icnsutil
if [[ "$#" -lt 2 ]]; then
echo "usage: icnsutil /path/to/1024x1024image"
exit 1
PIC_FOLDER="$(dirname "$PIC")"
CodeEagle / gist:6fc136bc0ea1d336b9bc6b41cb2d87d4
Created November 10, 2017 02:21
Digest Proxy Authorization
View gist:6fc136bc0ea1d336b9bc6b41cb2d87d4
public static func proxyAuthorizationFor(host: String, port: Int, username: String, password: String, destHost: String, destPort: Int) -> [String : String]? {
var input: InputStream?
var output: OutputStream?
Stream.getStreamsToHost(withName: host, port: port, inputStream: &input, outputStream: &output)
guard let input_ = input, let output_ = output else { return nil }
guard input_.streamError == nil, output_.streamError == nil else { return nil }
let method = "CONNECT"
let uri = "\(destHost):\(destPort)"
CodeEagle / ImageGenerator
Last active October 24, 2022 05:56
Generator for Assets.xcassets , Xcode Run Script
View ImageGenerator
# Generate UIImage extension for images assets, using in Xcode run script
content="import UIKit\nextension UIImage {\n"
DealWithFile() {
CodeEagle / _sudoku.swift
Created July 24, 2016 02:54 — forked from kristopherjohnson/_sudoku.swift
Sudoku solver in Swift
View _sudoku.swift
Copyright (c) 2015 Kristopher Johnson
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:
CodeEagle / Xcode Team Adding Build Number Shell Script
Last active July 4, 2020 10:32
Xcode Team Adding Build Number Shell Script
View Xcode Team Adding Build Number Shell Script
# 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)
cretePlist() {
CodeEagle / SHJON.swift
Last active August 29, 2015 14:23
SwiftyJSON work with HanekeSwift
View SHJON.swift
extension SwiftyJSON.JSON : DataConvertible, DataRepresentable {
public typealias Result = SwiftyJSON.JSON
public static func convertFromData(data:NSData) -> Result? {
if let obj: AnyObject = NSKeyedUnarchiver.unarchiveObjectWithData(data) {
return SwiftyJSON.JSON(obj)
return nullJSON
CodeEagle / Test.swift
Created April 29, 2015 01:50
ARC Retain Cycle Test
View Test.swift
class TestObj:UIView {
var done:(()->())!
deinit {
println("deinit TestObj")
func doNothing2(){
func doNothing(){