Skip to content

Instantly share code, notes, and snippets.

View shsteven's full-sized avatar

Steven Zhang shsteven

View GitHub Profile
1. `/etc/init.d/networking restart`
2. `ifup eth0` or `ifconfig eth0 up`
3. `ethtool eth0`
@shsteven
shsteven / Eureka.podspec
Last active July 25, 2017 03:15
Eureka Swift 3.2
Pod::Spec.new do |s|
s.name = 'Eureka'
s.version = '3.0.0'
s.license = 'MIT'
s.summary = 'Elegant iOS Forms in pure Swift'
s.homepage = 'https://github.com/xmartlabs/Eureka'
s.social_media_url = 'http://twitter.com/xmartlabs'
s.authors = { 'Martin Barreto' => '[email protected]', 'Mathias Claassen' => '[email protected]' }
s.source = { :git => 'https://github.com/xmartlabs/Eureka.git', :branch => 'feature/Xcode9-Swift3_2' }
s.ios.deployment_target = '8.0'
@shsteven
shsteven / .swiftlint.yml
Last active May 4, 2017 06:02
SwiftLint template
included:
- source
excluded:
- vendor
whitelist_rules:
# code formatting & syntax
- compiler_protocol_init
- control_statement
- empty_count
- empty_parameters
@shsteven
shsteven / Draco.podspec
Created March 31, 2017 02:32
This podspec is used to include license attribution for Draco
# This podspec is used to include license attribution for Draco
Pod::Spec.new do |s|
s.name = 'Draco'
s.version = '0.9.0'
s.summary = 'Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.'
s.homepage = 'https://github.com/google/draco'
s.license = { :type => 'Apache2', :file => 'LICENSE' }
s.author = 'Google Inc'
s.source = { :git => 'https://github.com/google/draco.git', :branch => 'master' }
@shsteven
shsteven / Draco.podspec
Last active March 31, 2017 02:31
This podspec is used to include license attribution for Draco
# This podspec is used to include license attribution for Draco
Pod::Spec.new do |s|
s.name = 'Draco'
s.version = '0.9.0'
s.summary = 'Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.'
s.homepage = 'https://github.com/google/draco'
s.license = { :type => 'Apache2', :file => 'LICENSE' }
s.author = 'Google Inc'
s.source = { :git => 'https://github.com/google/draco.git', :branch => 'master' }
@shsteven
shsteven / shutdown-all-vagrant-boxes.sh
Created August 12, 2016 10:17
Shutdown all vagrant boxes with this one liner
vagrant global-status | ruby -ane '`cd #{$F[4]} && vagrant halt` if $F[3] == "running"'
@shsteven
shsteven / splitBy.swift
Created July 28, 2016 03:01 — forked from ericdke/splitBy.swift
Swift: split array by chunks of given size
let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
extension Array {
func splitBy(subSize: Int) -> [[Element]] {
return 0.stride(to: self.count, by: subSize).map { startIndex in
let endIndex = startIndex.advancedBy(subSize, limit: self.count)
return Array(self[startIndex ..< endIndex])
}
}
}
@shsteven
shsteven / Dockerfile
Created April 5, 2016 07:24
Dokku + Dockerized static harp server
FROM node
RUN npm install -g harp
COPY . /src
WORKDIR /src
EXPOSE 9000
@shsteven
shsteven / vagrant-ssh-keys
Created February 18, 2016 05:03
Vagrant copy pre-generated ssh keys
# Copy local user's SSH key to /home/vagrant/.ssh/id_rsa
if File.exists?(File.join("ssh", "id_rsa"))
config.vm.provision :shell, :inline => "echo 'Copying local Git SSH Key to VM...'"
config.vm.provision :shell, :inline => "mkdir -p /home/vagrant/.ssh && cp /vagrant/ssh/* /home/vagrant/.ssh/ && chmod 600 /home/vagrant/.ssh/*"
config.vm.provision :shell, :inline => "sudo chown `id -u vagrant`:`id -g vagrant` /home/vagrant/.ssh/*"
else
# Else, throw a Vagrant Error. Cannot successfully startup without a GitHub SSH Key!
raise Vagrant::Errors::VagrantError, "\n\nERROR: GitHub SSH Key not found at ~/.ssh/id_rsa\n\n"
end
@shsteven
shsteven / YISplashScreen.podspec
Created September 30, 2014 07:13
YISplashscreen fork
Pod::Spec.new do |s|
s.name = 'YISplashScreen'
s.version = '1.2.1.1'
s.license = { :type => 'Beerware', :text => 'If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.' }
s.homepage = 'https://github.com/carlj/YISplashScreen'
s.author = { 'Yasuhiro Inami' => '[email protected]' }
s.summary = "Easy splash screen + animation maker for iOS5+."
s.screenshots = [ "https://raw.github.com/carlj/YISplashScreen/master/Screenshots/screenshot1.png" ]
s.source = { :git => 'https://github.com/carlj/YISplashScreen.git', :branch => "master" }
s.source_files = 'Classes/*.{h,m}'