Skip to content

Instantly share code, notes, and snippets.

View JStrawn's full-sized avatar

JStrawn

View GitHub Profile
// import_json_appsscript.js
// https://gist.github.com/allenyllee/c764c86ed722417948fc256b7a5077c4
//
// Changelog:
// (Oct. 16 2019) tag: allenyllee-20191016
// 1. Fixed google script error: urlfetchapp - service invoked too many times https://stackoverflow.com/questions/10598179/google-apps-script-urlfetchapp-service-invoked-too-many-times
// (Jul. 16 2018) tag: allenyllee-20180716
// 1. Fixed the issue "If you try to query /arrayA[k]/arrayB[n]/arrayC[m]/.../member, you will always get /arrayA[k]/arrayB[k]/arrayC[k]/.../member."
// (Nov. 30 2017) tag: allenyllee-20171130
// 1. Add the ability to query array elements by using xpath like "/array[n]/member" where "n" is array index
@ylem
ylem / CenterItemInCollectionView.playground
Last active January 5, 2024 03:28
Scrolling item on a horizontal UICollectionView, stopped item on center of screen.
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
class WLCollectionCell: UICollectionViewCell {
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@Limon-O-O
Limon-O-O / AVCaptureDevice+FrameRate.swift
Created October 31, 2016 07:48
Control video frame rate with AVFoundation
extension AVCaptureDevice {
/// http://stackoverflow.com/questions/21612191/set-a-custom-avframeraterange-for-an-avcapturesession#27566730
func configureDesiredFrameRate(_ desiredFrameRate: Int) {
var isFPSSupported = false
do {
if let videoSupportedFrameRateRanges = activeFormat.videoSupportedFrameRateRanges as? [AVFrameRateRange] {