Skip to content

Instantly share code, notes, and snippets.

View ms2sato's full-sized avatar

Masashi Sato ms2sato

View GitHub Profile
@sunaot
sunaot / writing_unit_test.md
Last active February 20, 2022 06:57
テストを書くか書かないかの判断の話

ユニットテストでテストを書くか書かないかの判断の話

お題

メソッドの出力の結果が、true か false のどちらでも返ってくる可能性がある場合、assert 文を書く時は true の場合だけで良いのだろうか

テストとは

まず、基本の考えとしてなぜテストをするのか?というのがあります。

@RobertoSchneiders
RobertoSchneiders / sidekiq.config
Created October 9, 2015 19:01 — forked from hiattp/sidekiq.config
Sidekiq Config for Elastic Beanstalk
# Sidekiq interaction and startup script
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
mode: "000755"
content: |
#!/bin/bash
. /opt/elasticbeanstalk/hooks/common.sh
. /opt/elasticbeanstalk/support/envvars
var AWS = require('aws-sdk');
var Client = require('amazon-api-gateway-client').Client;
var RequestLogger = require('stackable-fetcher').RequestLogger;
var ResponseLogger = require('stackable-fetcher').ResponseLogger;
var client = new Client({
accessKeyId: AWS.config.credentials.accessKeyId,
region: 'us-east-1',
secretAccessKey: AWS.config.credentials.secretAccessKey,
}).use(RequestLogger).use(ResponseLogger);
@aodin
aodin / gist:9493190
Last active March 23, 2024 20:24
Parsing JSON in a request body with Go
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
)
type Message struct {
var async_task = function (msg, delay) {
var dfd = $.Deferred();
setTimeout( function () {
if ( msg !== 'l' ) {
dfd.resolve('resolved:' + msg);
}
else {
dfd.reject('rejected:' + msg);
}

Sample PHP+Mongo app on Heroku

  1. Install any of the Mongo add-ons available at http://addons.heroku.com

  2. Vendor the Mongo driver with your application. You can download it here:

    https://github.com/wuputah/heroku-libraries/raw/master/php/mongo/mongo.so
    

    Add it to a folder like "ext".