Skip to content

Instantly share code, notes, and snippets.

View arthuralee's full-sized avatar

Arthur Lee arthuralee

View GitHub Profile
@arthuralee
arthuralee / iphonetrack.js
Created November 19, 2013 23:38
Queries the Apple Store servers to check for black iPhone 5ses in my zip code. Also sends a push notification via a Parse app
var request = require("request");
var models = {
"16 GB": "ME341LL%2FA",
"32 GB": "ME344LL%2FA",
"64 GB": "ME347LL%2FA"
};
var result = function(size) {
return function (error, response, body) {
@arthuralee
arthuralee / ytIdFromUrl.js
Created May 10, 2014 22:53
Get the youtube ID from a youtube URL
ytIdFromUrl = function(url) {
if (url.indexOf('youtu.be/') !== -1) {
var re = new RegExp('.+youtu\.be/([^?#]+)', 'gi');
var array = re.exec(url);
return array[1];
} else {
var re = new RegExp('.+watch\\?v=([^&#]+)', 'gi');
var array = re.exec(url);
return array[1];
}
@arthuralee
arthuralee / jquery.postJSON.js
Created July 20, 2014 22:04
jQuery postJSON
jQuery.extend({
postJSON: function(url, data, callback) {
return jQuery.ajax({
type: "POST",
url: url,
data: JSON.stringify(data),
success: callback,
dataType: "json",
contentType: "application/json",
processData: false
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
9572EC82265F22AF002CBCAF /* TestProjectApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9572EC81265F22AF002CBCAF /* TestProjectApp.swift */; };
2022-02-03 17:26:58.132 Db applesimutils[10601:a94f] [com.wix.applesimutils:CLI] Obtaining simulator device list
2022-02-03 17:26:58.133 Db applesimutils[10601:a94f] [com.wix.applesimutils:CLI] Running “/usr/bin/which” with argument: “xcrun”
2022-02-03 17:26:58.135 Db applesimutils[10601:a94f] [com.wix.applesimutils:CLI] Got output:
/usr/bin/xcrun
2022-02-03 17:26:58.136 Db applesimutils[10601:a94f] [com.wix.applesimutils:CLI] Running “/usr/bin/xcrun” with arguments: “simctl list --json”
2022-02-03 17:26:58.584 Db applesimutils[10601:a94f] [com.wix.applesimutils:CLI] Got output:
{
"devicetypes" : [
{
"minRuntimeVersion" : 327680,
{
"devicetypes" : [
{
"minRuntimeVersion" : 327680,
"bundlePath" : "\/Applications\/Xcode-13.0.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 4s.simdevicetype",
"maxRuntimeVersion" : 655359,
"name" : "iPhone 4s",
"identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-4s",
"productFamily" : "iPhone"
},