Skip to content

Instantly share code, notes, and snippets.

@akahigeg
akahigeg / gist:736193
Created December 10, 2010 13:24
TitaniumReporter for Jasmine
(function() {
if (! jasmine) {
throw new Exception("jasmine library does not exist in global namespace!");
}
var TitaniumReporter = function() {};
TitaniumReporter.prototype = {
reportRunnerStarting: function(runner) {
@akahigeg
akahigeg / amazon_ecs_with_memcache.rb
Created September 17, 2011 06:06
Amazon::Ecs response caching to memcached
# -*- coding: utf-8 -*-
require 'amazon/ecs'
require 'dalli'
require 'active_support/core_ext'
module Amazon
class Ecs
class << self
def send_request_with_memcache(opts)
@akahigeg
akahigeg / example.md
Created September 21, 2011 12:36
なんちゃってtoctree

toctree from /

<%= toctree :from => '/' %>

toctree from current item

<%= toctree %>

toctree include only specified directories

@akahigeg
akahigeg / Gemfile
Created June 20, 2013 08:11
for Nanoc with Pow
source 'http://rubygems.org'
gem 'bundler'
gem 'rack'
gem 'rack-rewrite'
gem 'mime-types'
gem 'nanoc', '3.4'
gem 'adsf'
gem 'haml'
gem 'sass'
@akahigeg
akahigeg / hoge.rb
Created June 21, 2013 04:25
テスト
p "HOGE!"
@akahigeg
akahigeg / thread_value_store.rb
Created July 22, 2013 13:54
use this instead of class valuables for thread safe.
# -*- encoding : utf-8 -*-
#
# for thread safe
#
class ThreadValueStore
@@value_store = {}
@@store_types = {}
def self.reserve(name, store_type = :value)
#
# Cookbook Name:: sensu-mailer-sample
# Recipe:: default
#
sensu_gem "mail"
mailer_rb_path = "#{node.sensu.directory}/handlers/mailer.rb"
cookbook_file mailer_rb_path do
source "mailer.rb"
#!/bin/bash
# Download dcpTool
# https://sourceforge.net/projects/dcptool/files/latest/download
# 作業フォルダを作成してその中に移動
cd ~
mkdir setup-k-1-mk2-profile-tmp
cd setup-k-1-mk2-profile-tmp
@akahigeg
akahigeg / functions.php
Last active June 1, 2018 01:43
wordpress-admin-modal
<?php
// 管理画面にCSSとJSの読み込みを追加
function enqueue_modal_files() {
wp_enqueue_style('modal-style' , get_stylesheet_directory_uri() . '/css/modal.css');
wp_enqueue_script('modal-js' , get_stylesheet_directory_uri() . '/js/modal.js');
}
add_action('admin_enqueue_scripts', 'enqueue_modal_files');
// AJAXリクエストに対してJSONを返す
function ajax_modal() {