Skip to content

Instantly share code, notes, and snippets.

@hito-asa
hito-asa / access.yml
Last active December 15, 2015 16:39 — forked from nakaearth/access.yml
localhost: &localnet
/admin/user:
- [ip address]
development:
<<: *localnet
test:
<<: *localnet
production:
/admin/point:
- [ip address]
@hito-asa
hito-asa / gist:5290892
Last active December 15, 2015 16:39 — forked from nakaearth/gist:5192827
private
def update_params
params.require(:hoge).permit(:title, :description, :priority, :status)
end
@hito-asa
hito-asa / gist:5185573
Created March 18, 2013 07:30
enable fullscreen mode for co-meeting
$(function() {
$("#account-menus ul").append("<li><a href='#' id='fullscreen-menu'>フルスクリーン</a></li>");
$("#fullscreen-menu").click(function () {
$("#header").remove();
$("#footer").remove();
$("#guide").remove();
$("#side-panel").remove();
$("#main-header").remove();
$("#main-subheader").remove();
$("#online-demo-support-tab").remove();
@hito-asa
hito-asa / gist:5097466
Created March 6, 2013 07:45
弊社でのSICP読書会@SICP大反省会

!SLIDE

弊社(GMOメディア)でのSICP読書会

!SLIDE

ABOUT ME:

  • 浅井です
  • @hito_asa
  • 注:SICP読書会の主催者ではありません

!SLIDE

oauth2_refresh_token = JSON.parse(`cat ~/.appcfg_oauth2_tokens`)["refresh_token"]
`#{$APPCFG} request_logs --oauth2 --noauth_local_webserver --oauth2_refresh_token=#{oauth2_refresh_token} --severity=1 --num_days=2 --end_date=#{TARGET_DATE_NAME} #{$SRC_DIR} #{LOG_TMP_DIR}/request.log`
`grep -s "^ [0-9]\\+:[0-9]\\+\\.[0-9]\\+ #{PREFIX_OF_ACTIVITY_LOG} \\(#{TARGET_DATE_PLUS1_NAME} 0[0-3]\\|#{TARGET_DATE_NAME} \\(0[4-9]\\|1[0-9]\\|2[0-3]\\)\\)" #{LOG_TMP_DIR}/request.log | sed "s/^ [0-9]\\+:[0-9]\\+\\.[0-9]\\+ #{PREFIX_OF_ACTIVITY_LOG} //" > #{LOG_FILE}`
GS_DIR = "gs://backetname/activity-log"
`#{$GSUTIL} cp #{LOG_FILE} #{GS_DIR}/#{TARGET_DATE_YMD}`
private void fetchAndWriteLog(LogQuery query, String fileName) throws Exception {
FileService fs = FileServiceFactory.getFileService();
AppEngineFile file = null;
FileWriteChannel channel = null;
Writer writer = null;
try {
long start = System.currentTimeMillis();
file = fs.createNewGSFile(new GSFileOptionsBuilder()
.setBucket(GS_BUCKET_NAME)
@SuppressWarnings("unchecked")
public static <T> T get(Object key) throws IllegalArgumentException {
return (T) delegate().get(key);
}
private[worker] case class QueueMonitor(processor: Processor) extends Actor with Logger {
private[this] val BLOCK_TIME = Some(1000L)
def act {
loop {
{
reactWithin(1000) {
case Take =>
// blocking dequeue
processor.queue.dequeue(BLOCK_TIME) map { message =>
@hito-asa
hito-asa / tumblr_gist.css
Created September 3, 2012 07:50
tumblr_gist
<!-- Gist CSS -->
<style type="text/css" media="screen">
.gist{
margin: 15px 0 !important;
}
.gist-file{
border: none !important;
}
.gist-meta{
class Fluent::SplitterOutput < Fluent::Output
Fluent::Plugin.register_output('splitter', self)
PATTERN_MAX_NUM = 20
(1..PATTERN_MAX_NUM).each do |i|
config_param ('pattern' + i.to_s).to_sym, :string, :default => nil
end
config_param :preserve_tag, :bool, :default => false