This file contains hidden or 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 Docomo | |
API_PREFIX = "https://api.apigw.smt.docomo.ne.jp" | |
constructor: (apiKey) -> | |
@apiKey = apiKey | |
@dialogueStatus = {} | |
@dialogue: (request, username, message, t = null) -> | |
url = "#{API_PREFIX}/dialogue/v1/dialogue?APIKEY=#{@apiKey}" |
This file contains hidden or 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
execute "apt-get update" | |
execute "download libjpeg-turbo.deb" do | |
command "wget http://sourceforge.net/projects/libjpeg-turbo/files/#{node[:libjpegturbo][:version]}/libjpeg-turbo-official_#{node[:libjpegturbo][:version]}_amd64.deb" | |
cwd "/tmp" | |
not_if "test -d /opt/libjpeg-turbo" | |
end | |
execute "install libjpeg-turbo" do | |
command "dpkg -i libjpeg-turbo-official_#{node[:libjpegturbo][:version]}_amd64.deb" |
This file contains hidden or 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 | |
rails new --api <project name> -T --skip-bundle --skip-test-unit -d mysql |
This file contains hidden or 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
execute "apt-get update" | |
execute "download libjpeg-turbo.deb" do | |
command "wget http://sourceforge.net/projects/libjpeg-turbo/files/#{node[:libjpegturbo][:version]}/libjpeg-turbo-official_#{node[:libjpegturbo][:version]}_amd64.deb" | |
cwd "/tmp" | |
not_if "test -d /opt/libjpeg-turbo" | |
end | |
execute "install libjpeg-turbo" do | |
command "dpkg -i libjpeg-turbo-official_#{node[:libjpegturbo][:version]}_amd64.deb" |
This file contains hidden or 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
"use strict"; | |
function timediff(datetime, check_time=null, with_time=false) { | |
check_time = check_time || Math.floor(new Date().getTime() / 1000); | |
let timediff = check_time - datetime; | |
if (timediff === 0) { | |
return "now"; | |
} | |
if (timediff < 60) { | |
return ""; |
This file contains hidden or 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
# coding: utf-8 | |
from collections import defaultdict | |
from django.db import models | |
from django.utils.functional import cached_property | |
class PlayerUnit(models.Model): | |
id = models.UUIDField(primary_key=True) | |
player_id = models.UUIDField(db_index=True) |
This file contains hidden or 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
function quoteReply(tweetId) { | |
var tweetText = document.getElementById("#" + tweetId).innerText; | |
var textarea = document.getElementById("#form-textarea"); | |
textarea.value = ">" + tweetText + "¥n"; | |
textarea.forcus(); | |
} |
This file contains hidden or 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 b in `git bra --merged | grep feature | sed -e 's/remotes\/origin\///g' | head -n 10`; do git push origin :$b; sleep 1; done |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Timeline</title> | |
</head> | |
<body> | |
<div> | |
<ul> | |
<li> | |
message1 |
This file contains hidden or 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 | |
public class GithubAPI { | |
public init() { | |
} | |
public func request<Endpoint: APIEndpoint>(endpoint: Endpoint, handler: (data, response, error) -> Void) { | |
let url = NSURL(string: "https://api.github.com/search/repositories?q=Hatena&page=1")! | |
let request = NSMutableURLRequest(URL: url) | |
request.SetValue("application/vnd.github.v3+json", forHTTPHeaderField: "Accept") |