View FTPUpload.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CFNetwork | |
public class FTPUpload { | |
fileprivate let ftpBaseUrl: String | |
fileprivate let directoryPath: String | |
fileprivate let username: String | |
fileprivate let password: String |
View Decorators.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"sort" | |
"time" | |
) | |
func main() { |
View SoundListViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SoundListViewController.swift | |
// SoundSampler | |
// | |
// Created by Nicholas Maccharoli on 2016/12/06. | |
// Copyright © 2016年 Nicholas Maccharoli. All rights reserved. | |
// | |
import UIKit | |
import AudioToolbox |
View hole_head.pjunoxl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<tal curprogram="0" version="1.1"> | |
<programs> | |
<program path="" programname="hole_head" modulation="0.0" dcolfovalue="0.4233498573303223" | |
dcopwmvalue="0.1031103730201721" dcopwmmode="1.0" dcopulseenabled="1.0" | |
dcosawenabled="1.0" dcosuboscenabled="1.0" dcosuboscvolume="1.0" | |
dconoisevolume="0.0" hpfvalue="0.0" filtercutoff="0.473753035068512" | |
filterresonance="0.4271174967288971" filterenvelopemode="1.0" | |
filterenvelopevalue="0.09792116284370422" filtermodulationvalue="0.5374104976654053" |
View Inefficient-Rod-Cut.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func maxProfitRodCut(prices: [Int], length: Int) -> Int { | |
if length <= 0 { | |
return 0 | |
} | |
var currentMax = Int.min | |
for index in (1...length) { | |
currentMax = max(currentMax, prices[index - 1] + maxProfitRodCut(prices: prices, length: length - index)) | |
} | |
return currentMax | |
} |
View NaiveGraphs.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
class Graph { | |
let size: Int | |
private var nodes: [[Int]] | |
init(size: Int) { |
View .gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ---------- File system related ---------- | |
.DS_Store | |
## ---------- Build Related ---------- | |
build/ | |
DerivedData | |
build.xcarchive | |
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 |
View Raw-String-Interpolation.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let example: Int = 42 | |
"This is a conventional string with interpolation: \(example)" | |
#"This is a raw string with interpolation: \#(example)"# | |
##"This is a string with raw pound signs with interpolation \##(example)"## |
View CardboardBox.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct CardboardBox: Codable { | |
let brand: String | |
let width: Double | |
let height: Double | |
let depth: Double | |
let flavor: String? | |
} |
View vim-swift-syntax-highlighting.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone --depth 1 https://github.com/apple/swift.git # a shallow clone will do | |
mkdir -p ~/.vim # make a vim folder if its not available already | |
cp -a ./swift/utils/vim/ ~/.vim # just copy over the contents of utils/vim as they are | |
rm -rf # this is just for cleanup |
NewerOlder