Skip to content

Instantly share code, notes, and snippets.

View gist:605c6cf28957753931615568340a330f
# 如果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 Jul 16, 2017
Postfix配置
View main.cf
# 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
View start_ufw.sh
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 Dec 17, 2016 — forked from dominikwilkowski/README.md
Ubuntu 16.04 setup with NGINX http/2 and letsencrypt
View README.md

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 Nov 28, 2016 — forked from turtlesoupy/nginx.conf
node.js upstream nginx config
View nginx.conf
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 Nov 26, 2016 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
View README.md
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 Aug 8, 2016
xdream86/jenkins-node-docker-image
View Dockerfile
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
View gist:9d3fc5ea3a5cb62b9ac46007929edac8
#!/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 Jun 8, 2016 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@xdream86
xdream86 / iOSMapKitFitAnnotations.m
Created Dec 16, 2015 — forked from andrewgleave/iOSMapKitFitAnnotations.m
Zooms out a MKMapView to enclose all its annotations (inc. current location)
View iOSMapKitFitAnnotations.m
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);
}
}