Skip to content

Instantly share code, notes, and snippets.

View ryanhanwu's full-sized avatar
🎯
Focusing

Ryan Wu ryanhanwu

🎯
Focusing
View GitHub Profile
@ryanhanwu
ryanhanwu / build.config
Last active July 28, 2023 23:36
My iOS IPA build script for XCode workspace with CocoaPods installed
#Code Sign
PRODUCT_NAME="MyApp"
WORKSPACE_NAME=$PRODUCT_NAME
SCHEME_NAME=$PRODUCT_NAME
DEVELOPER_NAME="iPhone Developer: XXXXXXXX (2CA66F8Y8L)"
PROVISONNING_PROFILE_DEBUG="profile/OOO.mobileprovision"
PROVISONNING_PROFILE_RELEASE="profile/XXXXX.mobileprovision"
@ryanhanwu
ryanhanwu / Brewfile
Last active July 19, 2023 05:22
New Mac Setup Script 2021
# Taps
tap 'homebrew/cask-fonts'
tap 'homebrew/cask-versions'
tap 'heroku/brew'
# Install CLI Tools
## Shell Utilities
brew 'coreutils'
brew 'findutils'
brew 'autojump'
@ryanhanwu
ryanhanwu / Dockerfile
Created February 26, 2019 17:27
muti-stage build for node+babel+docker
# common base image for development and production
FROM node:10.11.0-alpine AS base
WORKDIR /app
# dev image contains everything needed for testing, development and building
FROM base AS development
COPY package.json yarn.lock ./
# first set aside prod dependencies so we can copy in to the prod image
@ryanhanwu
ryanhanwu / mapViewController.m
Last active November 4, 2022 11:43
Calculate Google Map length in meters with zoom level in #Objective-C (converted from #JavaScript) #iOS #Swift
- (void)mapView:(GMSMapView*)mapView idleAtCameraPosition:(GMSCameraPosition*)position
{
CLLocationCoordinate2D topLeft = mapView.projection.visibleRegion.farLeft;
CLLocationCoordinate2D bottomLeft = mapView.projection.visibleRegion.nearLeft;
double lat = fabs(topLeft.latitude - bottomLeft.latitude);
double mpp = cos(lat * M_PI / 180) * 2 * M_PI * 6378137 / (256 * pow(2, mapView.camera.zoom));
double distance = mpp * mapView.frame.size.width;
[[SearchManager shareInstance] distance: distance];
}
@ryanhanwu
ryanhanwu / index.js
Created January 22, 2021 19:17
A gist for first Tailwind CSS page
export default function Home() {
return (
<main className="container mx-auto px-4">
<div>
<section className="py-12 px-4 text-center">
<div className="w-full max-w-2xl mx-auto">
<span className="text-sm font-semibold">Next.js + Tailwind CSS + Firebase Cloud Functions + Github Actions</span>
< h2 className = "text-5xl mt-2 mb-6 leading-tight font-semibold font-heading" >Project Header</h2>
<a className="text-indigo-600 hover:underline" href="#">Learn more &raquo;</a>
</div>
@ryanhanwu
ryanhanwu / ipad.css
Created August 30, 2012 09:00
ipad specific css (responsive)
@media only screen and (device-width: 768px) {
/* For general iPad layouts */
}
@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait) {
/* For portrait layouts only */
}
@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape) {
/* For landscape layouts only */
@ryanhanwu
ryanhanwu / httpsExpressApp.js
Created April 5, 2013 17:57
Express JS HTTP + HTTPs server (including auto redirect)
var express = require('express'),
routes = require('./routes'),
upload = require('./routes/upload'),
http = require('http'),
https = require('https'),
fs = require('fs'),
path = require('path'),
httpApp = express(),
app = express(),
certPath = "cert";
@ryanhanwu
ryanhanwu / cloudSettings
Last active April 27, 2021 14:20
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-04-27T14:20:49.226Z","extensionVersion":"v3.4.3"}
@ryanhanwu
ryanhanwu / myViewController.h
Created December 6, 2012 07:20
[iOS] Get current location and city name
@interface myViewController: UIViewController <CLLocationManagerDelegate>
CLLocationManager *locationManager;
CLLocation *currentLocation;
@end
@ryanhanwu
ryanhanwu / .env
Created February 23, 2021 20:49 — forked from joshdholtz/.env
Using Dotenv and environment variables with fastlane
STUFF = this is some stuff