Skip to content

Instantly share code, notes, and snippets.

View shayanbo's full-sized avatar

Yanbo Sha shayanbo

View GitHub Profile
@shayanbo
shayanbo / GetCommitSHA1WithCommitCount
Last active June 21, 2016 03:04
Get commit SHA1 with commit count from some branch.
#!/usr/bin/ruby
# get commit SHA1 with commit count.
commitCount=5648
branch='HEAD'
ruby -e 'puts `git rev-list #{branch}`.split.reverse[#{commitCount}-1]'
#! /usr/bin/ruby
oldCommit = ARGV[0]
newCommit = ARGV[1]
puts "Analysing..."
commits=`git rev-list #{oldCommit}..#{newCommit}`.split
binary_infos = []
@shayanbo
shayanbo / SRTConverter.swift
Last active September 22, 2016 08:04
Convert srt(subtitle) to common article
//
// main.swift
// SRTConverter
//
// Created by shayanbo on 22/09/2016.
// Copyright © 2016 shayanbo. All rights reserved.
// using swift3.0
import Foundation
@shayanbo
shayanbo / AsyncImage.swift
Last active July 6, 2023 09:42
Enhanced AsyncImage Sample
import SwiftUI
import CommonCrypto
struct AsyncImage<Content> : View where Content: View {
enum Error : Swift.Error {
case invalidData
}
private let url: URL