This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call the 'minElement()' method on the sequence | |
call the 'maxElement()' method on the sequence | |
call the 'indexOf()' method on the collection | |
|Use the split() method instead. | |
call the 'startsWith()' method on the sequence | |
call the 'startsWith()' method on the sequence | |
call the 'enumerate()' method on the sequence | |
call the 'equalElements()' method on the sequence | |
call the 'equalElements()' method on the sequence | |
call the 'lexicographicalCompare()' method on the sequence |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A test case that displays an animated weather layer on top of | |
// the standard Geography Class basemap. | |
// This is part of the AutoTester in the WhirlyGlobe-Maply repo. | |
class AnimatedBasemapTestCase: MaplyTestCase { | |
// Use Geography Class as the base layer | |
let geographyClass = GeographyClassTestCase() | |
let cacheDir = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true)[0] | |
var tileSources = [MaplyRemoteTileInfo]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Person { | |
let name: String | |
let lastname: String | |
} | |
class Reflection { | |
func printProperties(mirror: _MirrorType) { | |
for i in 0..<mirror.count { | |
let (name, childMirror) = mirror[i] | |
let value = childMirror.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Enable MySQL General Log | |
SET global general_log = 1; | |
SET global log_output = 'table'; | |
--MySQL Dump | |
mysqldump -uroot -ppassword dbname > dump.sql | |
--enable access from a particular system | |
GRANT ALL PRIVILEGES ON *.* TO root@106.51.132.21 identified by "password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## MySQL 5.1.61 | |
## sleep时间大于等于10秒,kill掉: | |
mysqladmin -u* -p* processlist |grep -i sleep |awk '{if($12>=10) print $2}' |xargs -n1 mysqladmin -u* -p* kill | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/projects | |
cd ~/projects | |
git clone --recurse-submodules https://github.com/petewarden/tensorflow_ios.git tensorflow_ios | |
cd tensorflow_ios | |
mkdir tools | |
mkdir tools/objc | |
echo ' | |
filegroup( | |
name = "default_provisioning_profile", | |
srcs = ["default_provisioning_profile.mobileprovision"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
MAINTAINER Dave Martin <David.Martin@csiro.au> | |
RUN apt-get update && apt-get -y install openssh-server supervisor | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:password' | chpasswd | |
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config | |
# SSH login fix. Otherwise user is kicked off after login | |
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
webclient: | |
environment: | |
- NODE_ENV=production | |
- VIRTUAL_HOST=myapp.com | |
build: 'webclient' # this directory must have a Dockerfile | |
links: | |
- mongo | |
restart: always | |
lb: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM buildkite/agent | |
RUN apt-get update -y && \ | |
apt-get install --no-install-recommends -y -q curl build-essential ca-certificates git mercurial bzr | |
RUN mkdir /goroot && curl https://storage.googleapis.com/golang/go1.4.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1 | |
RUN mkdir /gopath | |
ENV GOROOT /goroot | |
ENV GOPATH /gopath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
import RemoteClient | |
class HelloWorldViewController: UIViewController { | |
... | |
@IBAction func requestButtonPressed(sender: UIButton) { | |
// For debug | |
// 非SSLでの接続には必要 |
OlderNewer