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
provider "aws" {} | |
# | |
# VPC | |
# | |
resource "aws_vpc" "vpc" { | |
cidr_block = "10.10.0.0/16" | |
instance_tenancy = "default" | |
enable_dns_hostnames = true |
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
class Token | |
include ActiveModel::Model | |
attr_accessor :email | |
validate :ensure_effective_token | |
def initialize(token, email, expire_at) | |
@token, @email, @expire_at = token, email, expire_at | |
end |
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
name="1syo" | |
data_url="$(curl http://lgtm.in/g/$name --write-out "%{redirect_url}" --silent)" | |
image_url="$(echo $data_url | sed -e 's/http:\/\/lgtm.in\/i/http:\/\/lgtm.in\/p/g')" | |
cat <<-__TEXT__ | |
LGTM :+1: | |
[]($data_url) | |
__TEXT__ |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/cache/jenkins/war; | |
index index.html; | |
server_name _; | |
server_tokens off; | |
location / { | |
auth_basic "Restricted"; |
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/bash | |
if [ $# -ne 1 ]; then | |
echo 'Argumant error.' | |
exit 1 | |
fi | |
repo=$1 | |
header="Accept: application/vnd.travis-ci.2+json" | |
url="https://api.travis-ci.org/repos/${repo}/builds" |
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
class CreateArticles < ActiveRecord::Migration | |
def change | |
create_table :articles do |t| | |
t.string :title, null: false | |
t.text :content, null: false | |
t.binary :image | |
t.timestamps null: false | |
end | |
end | |
end |
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
# Description: | |
# Gmail messege. | |
# | |
google = require('googleapis') | |
googleAuth = require('google-auth-library') | |
CronJob = require('cron').CronJob | |
_ = require('underscore') | |
SLACK_USER_NAME = process.env.SLACK_USER_NAME || '' | |
CLIENT_SECRET = process.env.CLIENT_SECRET || '' | |
CLIENT_ID = process.env.CLIENT_ID || '' |
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 arg1 = process.argv[2]; | |
var arg2 = process.argv[3]; | |
import {PI, sqrt, square} from './Math'; | |
console.log(PI); | |
console.log(sqrt(+arg1)); | |
console.log(square(+arg2)); |
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
# Description: | |
# Yammer messege. | |
# | |
YAMMER_USER_ID = process.env.YAMMER_USER_ID || 0 | |
YAMMER_API_TOKEN = process.env.YAMMER_API_TOKEN || "" | |
ROOM_NAME = process.env.ROOM_NAME || "general" | |
KEY = 'yammer-latest-message-id' | |
Yammer = new require('yammer').Yammer | |
CronJob = require('cron').CronJob |
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
# Description: | |
# Example scripts for you to examine and try out. | |
# | |
util = require('util') | |
module.exports = (robot) -> | |
robot.respond /node\sversion/i, (msg) -> | |
msg.send "My node version is: #{process.version}" | |
robot.respond /env/i, (msg) -> | |
msg.send "My environment is: #{util.inspect(process.env,false,null)}" |