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
# ubuntu 14.04 for Gitlab | |
FROM ubuntu:14.04 | |
MAINTAINER hogehoge | |
RUN apt-get update | |
RUN apt-get -y install wget zip gcc openssh-server postfix | |
RUN wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.1.1-omnibus-1_amd64.deb | |
RUN dpkg -i gitlab_7.1.1-omnibus-1_amd64.deb |
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
docker pull sameersbn/gitlab:latest | |
docker run --name='gitlab' -it --rm -p 10022:22 -p 10080:80 -e 'GITLAB_PORT=10080' -e 'GITLAB_SSH_PORT=10022' sameersbn/gitlab:latest |
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
// for GitHub webhook | |
router.all('/webhook', function(req, res) { | |
var cmd = exec("git pull", { | |
cwd: conf.deploy.dir | |
}, function(error, stdout, stderr) { | |
if (error) { | |
debug("> ERROR (error): " + error); | |
} | |
if (stderr && error) { | |
debug("> ERROR (error): " + error); |
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
var today = new Date(); | |
new Date(today.getFullYear(), today.getMonth() + 1, 0); | |
// error | |
dt.setFullYear(today.getFullYear()); | |
dt.setMonth(today.getMonth()+1); | |
dt.setDate(0); | |
dt.getDate(); |
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
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { | |
println("AccountsViewController#tableView cellForRowAtIndexPath called.") | |
let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell") | |
// ユーザIDを表示する | |
cell.textLabel?.text = accounts[indexPath.row].username | |
// プロフィール画像を取得して非同期で表示させる | |
var q_global: dispatch_queue_t = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
var q_main: dispatch_queue_t = dispatch_get_main_queue(); | |
cell.imageView?.image = nil; | |
dispatch_async(q_global, { |
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
#!/usr/bin/env python | |
import os | |
import commands | |
# logging config | |
from logging import getLogger,StreamHandler,Formatter,DEBUG | |
logger = getLogger(__name__) | |
handler = StreamHandler() | |
handler.setLevel(DEBUG) | |
handler.setFormatter(Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')) |
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
/* | |
* 使いにくい部分があったのでいろいろ直していますが | |
* 基本は以下のライブラリのソースを使っています。 | |
* | |
* Sitemap Parser | |
* Copyright (c) 2014 Sean Thomas Burke | |
* Licensed under the MIT license. | |
* https://github.com/hawaiianchimp/sitemap-parser.git | |
*/ |
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
var projectId = process.env.GCLOUD_PROJECT_ID | |
var gcloud = require('gcloud')({ | |
projectId: projectId, | |
keyFilename: '/local/path/to/keyfile' | |
}); | |
var storage = gcloud.storage(); | |
var bucket = storage.bucket('storageName'); | |
var options = { | |
destination: '2015/05/file', |
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
var Mail = Application("Mail"); | |
Mail.includeStandardAdditions = true; | |
// 選択したメッセージを取得 | |
var messages = Mail.selection(); | |
for (i = 0; i < messages.length; i++) { | |
var thisMessage = messages[i]; | |
// メッセージに添付されたファイルを取得しhogehogeユーザホームに保存する | |
var atFiles = thisMessage.mailAttachments(); |
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
select | |
id, | |
case | |
when ((dt_bit & 31) = 31) then 5 | |
when ((dt_bit & 15) = 15) then 4 | |
when ((dt_bit & 7) = 7) then 3 | |
when ((dt_bit & 3) = 3) then 2 | |
when ((dt_bit & 1) = 1) then 1 | |
else 0 | |
end as fq |
OlderNewer