Skip to content

Instantly share code, notes, and snippets.

View dev4dev's full-sized avatar
💭
Beep Boop Beep

Alex Antonyuk dev4dev

💭
Beep Boop Beep
View GitHub Profile
@dev4dev
dev4dev / instruction.md
Last active March 4, 2016 11:10
ClangFormat

Clang Formatter

  1. Install Alcatraz
  2. Install ClangFormat Plugin ClangFormat
  3. Restart Xcode
  4. Download .clang-format.yml to your home directory
  curl -L -o ~/.clang-format https://gist.githubusercontent.com/dev4dev/78d0508304558e969b2a/raw/9bab5aefe2e29f4b7b6a5560642618e1e78b397c/.clang-format.yml
// some shared services
protocol NetworkService: class {
func get() -> Any
}
class TestnetworkService: NetworkService {
func get() -> Any {
return "GET IT"
}
}
let a = "13"
let b = "13a"
if let a = Int(a), let b = Int(b) {
let result = a + b
print(result) // will print only if b is correct number
} else {
print("fuck you spilberg")
}
@dev4dev
dev4dev / shit.js
Last active November 17, 2018 16:23
shit parser
const data = "https://res.cloudinary.com/indysigner/image/fetch/f_auto,q_auto/w_400/https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/1565855a-e53b-408b-b12f-b6f3115a8d84/3-accessible-presentations.jpg 400w,https://res.cloudinary.com/indysigner/image/fetch/f_auto,q_auto/w_800/https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/1565855a-e53b-408b-b12f-b6f3115a8d84/3-accessible-presentations.jpg 800w, https://res.cloudinary.com/indysigner/image/fetch/f_auto,q_auto/w_1200/https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/1565855a-e53b-408b-b12f-b6f3115a8d84/3-accessible-presentations.jpg 1200w, https://res.cloudinary.com/indysigner/image/fetch/f_auto,q_auto/w_1600/https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/1565855a-e53b-408b-b12f-b6f3115a8d84/3-accessible-presentations.jpg 1600w, https://res.cloudinary.com/indysigner/image/fetch/f_auto,q_auto/w_2000/https://cloud.netlifyusercontent.com
@dev4dev
dev4dev / swv.rb
Last active April 26, 2022 12:05
omzsh xcode verison
#!/usr/bin/env ruby
require 'open3'
# swift version
def swift_version(format = "Swift %{v}")
output, _, _ = Open3.capture3('swift --version')
match = output.split("\n").first.match('version (\d\.\d)')