Skip to content

Instantly share code, notes, and snippets.

# 如果Framework中还需要使用资源文件,请将资源文件单独复制到一个bundle中,使用一个文件夹包含.framework和.bundle
Target_Name="YourTargetName"
# 在build/Release-iphoneos/${Target_Name}.framework下创建真机framework
xcodebuild -configuration Release -target "${Target_Name}" -sdk iphoneos clean build
# 在build/Release-iphonesimulator/${Target_Name}.framework下创建模拟器framework
xcodebuild -configuration Release -target "${Target_Name}" -sdk iphonesimulator
Device_Dir=build/Release-iphoneos/${Target_Name}.framework
@xdream86
xdream86 / main.cf
Created July 16, 2017 11:29
Postfix配置
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
@xdream86
xdream86 / start_ufw.sh
Created January 23, 2017 03:19
ufw自启动
Hi Oliver
Your solution is the simplest solution and that worked for me. Here's what i did
To start ufw on boot
Create a shell script
Sudo nano start_ufw.sh containing 2 lines
#!/bin/sh
/usr/sbin/ufw enable
Ctrl-X to save it
sudo cp start_ufw.sh /etc/rc.local
To check:
@xdream86
xdream86 / README.md
Created December 17, 2016 02:28 — forked from dominikwilkowski/README.md
Ubuntu 16.04 setup with NGINX http/2 and letsencrypt

Intro

This is a basic collection of things I do when setting up a new headless ubuntu machine as a webserver. Following the steps below should give you a reasonable secure server with HTTP/2 support (including ALPN in chrome) and the fast NGINX server. I am happy to add things so leave a comment.

Basics

After creating the server (droplet on DigitalOcean) log in with

@xdream86
xdream86 / nginx.conf
Created November 28, 2016 07:16 — forked from turtlesoupy/nginx.conf
node.js upstream nginx config
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@xdream86
xdream86 / README.md
Created November 26, 2016 14:41 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@xdream86
xdream86 / Dockerfile
Created August 8, 2016 15:29
xdream86/jenkins-node-docker-image
File Edit Options Buffers Tools Help
FROM jenkins:2.7.1
USER root
RUN apt-get update \
&& curl -sL https://deb.nodesource.com/setup_4.x | bash \
&& apt-get install -y nodejs \
&& wget -qO- https://get.docker.com/ | sh \
&& apt-get install -y emacs
RUN npm install -g mocha
USER jenkins
#!/bin/sh
apt-get update
# docker
wget -qO- https://get.docker.com/ | sh
# compose
curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# emacs
sudo apt-get install emacs
@xdream86
xdream86 / introrx.md
Created June 8, 2016 08:04 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@xdream86
xdream86 / iOSMapKitFitAnnotations.m
Created December 16, 2015 09:52 — forked from andrewgleave/iOSMapKitFitAnnotations.m
Zooms out a MKMapView to enclose all its annotations (inc. current location)
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}