Skip to content

Instantly share code, notes, and snippets.

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

Xu frankxzx

🏠
Working from home
View GitHub Profile
@monmonja
monmonja / generate-ios.sh
Created July 16, 2019 13:16
generate ios from command line
# download this file to your project folder and excute
# chmod +x generate-ios.sh
# then run using
# ./generate-ios.sh
# flutter build defaults to --release
flutter build ios
# make folder, add .app then zip it and rename it to .ipa
mkdir -p Payload
@shane-harper
shane-harper / appCenterUpload.sh
Created March 6, 2019 13:17
Simple AppCenter Upload Script
#!/bin/sh
owner_name="appcenter-username"
app_name="App-Name"
token="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
build_path="Unity-iPhone.ipa"
destination_name="Collaborators"
release_notes="Release notes go here"
# Step 1: Create an upload resource and get an upload_url (good for 24 hours)
request_url="https://api.appcenter.ms/v0.1/apps/${owner_name}/${app_name}/release_uploads"
@dlo
dlo / generate_iconset_contents.py
Created November 1, 2017 01:01
Automatically generate a Content.json file for an iOS icon set from a list of iOS icons in a folder.
#!/usr/bin/env python
# Usage: ls *.png | ./generate_iconset_contents.py
import sys
import re
import json
r = re.compile(".*(AppStore|iPhone|iPad).*-([\d\.]+)(@\dx)?\.png")
@collinjackson
collinjackson / main.dart
Last active November 29, 2022 06:38
Demonstrates scrolling a focused widget into view
// Copyright 2017, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
/// A widget that ensures it is always visible when focused.
@alswl
alswl / hosts
Last active November 12, 2023 11:17
(deprecated, I bought xiaomi VIP)hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@bcattle
bcattle / PhotoLibraryAssetManager.swift
Created November 2, 2016 22:07
Photo Library Asset Manager, a code sample illustrating an asynchronous queue loading assets from Apple's iCloud service
//
// PhotoLibraryAssetManager.swift
// Koowalla
//
// Created by Bryan Cattle on 8/22/16.
// Copyright © 2016 Koowalla, Inc. All rights reserved.
//
import UIKit
import Bolts
@cocoaNib
cocoaNib / exportOptionsAdHoc.plist
Last active April 2, 2024 01:41
Xcode build with exportOptionsPlist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
</dict>
</plist>
@keighl
keighl / CBGameController.m
Last active September 1, 2018 17:24
SDWebImage in a UITableViewCell - cancel any download operation before reusing the cell. Otherwise, you might see previous images loading in before the correct one is finished downloading.
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = @"MoveViewCell";
CBMoveView *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (!cell)
cell = [[CBMoveView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
cell.move = (CBMove *)[self.moves objectAtIndex:indexPath.row];