Skip to content

Instantly share code, notes, and snippets.

View 2bethere's full-sized avatar

Will Xu 2bethere

View GitHub Profile
@2bethere
2bethere / image.rb
Created May 23, 2014 07:02
Multiple file upload for Rails 4 params
class Image < ActiveRecord::Base
belongs_to :post
has_attached_file :file, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png"
validates_attachment_content_type :file, :content_type => /\Aimage\/.*\Z/
end
### Keybase proof
I hereby claim:
* I am 2bethere on github.
* I am willxu (https://keybase.io/willxu) on keybase.
* I have a public key whose fingerprint is A207 8A94 907E 9F0F B8D4 EC39 5309 0493 D517 98FF
To claim this, I am signing this object:
@2bethere
2bethere / keybase.md
Created December 28, 2015 05:09
keybase.md

Keybase proof

I hereby claim:

  • I am 2bethere on github.
  • I am 2bethere (https://keybase.io/2bethere) on keybase.
  • I have a public key whose fingerprint is 57E4 7BAB 74E8 5677 594F 691D 9BD5 2F2A EE39 A0C3

To claim this, I am signing this object:

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
| Explain |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
| Plan not optimized by CBO. |
|
<?xml version="1.0" encoding="utf-8"?>
<ProgressionData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MissionProgression>
<item>
<key>
<string>gameoverviewtutorial</string>
</key>
<value>
<boolean>true</boolean>
</value>
@2bethere
2bethere / collect_config.py
Created February 15, 2021 22:13
dump_druid_data_shape
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@2bethere
2bethere / docker-compose.yml
Last active April 8, 2021 17:01
Single node ELK stack
version: '2.2'
services:
es:
image: docker.elastic.co/elasticsearch/elasticsearch:latest
container_name: es
environment:
- node.name=es
- cluster.name=es-docker-cluster
- cluster.initial_master_nodes=es
- bootstrap.memory_lock=true
@2bethere
2bethere / Dockerfile
Created June 10, 2023 22:51
Druid 26 kafka
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@2bethere
2bethere / pcf.conf
Created September 29, 2023 03:10
vc.minitoken.com
# 头部描述信息(可选)
# 在 PCL 的头部一般添加上本文件和作者的描述信息,在 Potatso App 中暂时没有实际作用。
name = "VC Minitoken"
author = "VC Minitoken Author"
email = "admin@minitoken.com"
website = "http://manual.potatso.com"
description = "Over the wall"
# 用户配置(Profile)
[PROFILE.minitoken]