Skip to content

Instantly share code, notes, and snippets.

View cutePanda123's full-sized avatar
🏠
Working from home

pancodaffee cutePanda123

🏠
Working from home
  • On the road
View GitHub Profile
@cutePanda123
cutePanda123 / gist:53971c4d81c9ae6924474e3b6df13019
Created March 27, 2024 23:27 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@cutePanda123
cutePanda123 / gist:55c3498c56103037d235595b9f83feed
Created February 16, 2022 22:27
xcode build webdriveragent output
xcodebuild build-for-testing test-without-building -project /Users/lonli/Codes/BingAdsMobile/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/lonli/Library/Developer/Xcode/DerivedData/WebDriverAgent-cjolagzlearxtzgcxjcuqpbxatgo -destination id=0D197F7D-002E-4D57-83EC-469E1F8F3356 IPHONEOS_DEPLOYMENT_TARGET=15.0 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Users/lonli/Codes/BingAdsMobile/node_modules/appium-webdriveragent
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build-for-testing test-without-building -project /Users/lonli/Codes/BingAdsMobile/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/lonli/Library/Developer/Xcode/DerivedData/WebDriverAgent-cjolagzlearxtzgcxjcuqpbxatgo -destination id=0D197F7D-002E-4D57-83EC-469E1F8F3356 IPHONEOS_DEPLOYMENT_TARGET=15.0 GCC_TREAT_WARNINGS_AS_ERRORS=0 "COMPILER_INDE
@cutePanda123
cutePanda123 / gist:0a911282ca33225426c24bf1ab80a045
Created February 16, 2022 21:32
appium log with showXcodeLog and showIOSLog enabled
This file has been truncated, but you can view the full file.
yarn run v1.22.10
$ bash __tests__/appium/scripts/appium_test.sh ios
(DEBUG) Running UI Test with following parameters:
Platform: ios
Suite: all
Partition count: 0
Config: __tests__/library/jest-appium-si.config.json
Parallel: 1
Test mode: normal
Test filter:
@cutePanda123
cutePanda123 / gist:58edecde630af3b13d96bce592d6f183
Created February 16, 2022 18:05
appium log with showXcodeLog and showIOSLog enabled
yarn run v1.22.10
$ bash __tests__/appium/scripts/appium_test.sh ios
(DEBUG) Running UI Test with following parameters:
Platform: ios
Suite: all
Partition count: 0
Config: __tests__/library/jest-appium-si.config.json
Parallel: 1
Test mode: normal
Test filter:
@cutePanda123
cutePanda123 / gist:fecbb343fc17d847cdaab685c1a0966b
Created February 16, 2022 17:52
appium log with showXcodeLog disabled
yarn run v1.22.10
$ bash __tests__/appium/scripts/appium_test.sh ios
(DEBUG) Running UI Test with following parameters:
Platform: ios
Suite: all
Partition count: 0
Config: __tests__/library/jest-appium-si.config.json
Parallel: 1
Test mode: normal
Test filter:
@cutePanda123
cutePanda123 / Apple_mobile_device_types.txt
Created October 5, 2021 19:24 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S