Skip to content

Instantly share code, notes, and snippets.

package idobata_client
import "net/http"
import "net/url"
import "fmt"
const WEBHOOK_URL = "https://idobata.io/hook/custom/1f0794ab-dde4-4255-a750-0d7aa7e12714"
func PostByWebhook(message string) {
req_body := url.Values{}
@aikyo02
aikyo02 / go_openweathermap_sample.go
Last active August 28, 2018 14:25
APIを叩いてJSONにするところまで
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/json"
)
const API_KEY = "xxxxxxxxxxxxxxx"
defmodule CalculaMachine do
def calculate(encoded_string) do
_size, encoded_value = String.split(encoded_string, ":")
to_bit(encoded_string)
|> to_numerical_fomula()
|> calculate_formula()
|> encode()
end
Win = {'P' => 'R', 'R' => 'S', 'S' => 'P'}
Lose = {'P' => 'S', 'R' => 'P', 'S' => 'R'}
def solve(input)
tournaments = create_tournaments(input)
tournaments = calculate_tournaments(tournaments)
"(#{tournaments[0]})"
end
class OfficeTable
def initialize
@table = Array.new(8, 0)
end
def attend(customer_count)
if @table.all?{ |e| e == 0}
for i in 0..(customer_count-1) do
@table[i] = 3
end
require "cipher_word/version"
module CipherWord
def self.cipher(word)
cipher = ''
word.each_codepoint do |code|
code += 1
cipher += code.chr
end
cipher
require 'rake/clean'
CC = "gcc"
SRCS = FileList["**/*.c"]
OBJS = SRCS.ext('o')
CLEAN.include(OBJS)
CLOBBER.include("main")
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>美味しいカレーの作り方</title>
<meta name="description" content="美味しいカレーのレシピです。野菜の嫌いな人にもオススメ!">
</head>
<body>
<article>
<header>