Skip to content

Instantly share code, notes, and snippets.

@goosys
goosys / result.txt
Created November 9, 2016 18:37
skip_carrierwave_callbacks
------------------------ all skip
"Material"
:save
{}
:commit
{}
:update
{}
------------------------ no skip
function CompatibilityCheck() {
hasWebGL ? mobile ? confirm("Please note that Unity WebGL is not currently supported on mobiles. Press Ok if you wish to continue anyway.") || window.history.back() : -1 == browser.indexOf("Firefox") && -1 == browser.indexOf("Chrome") && -1 == browser.indexOf("Safari") && (confirm("Please note that your browser is not currently supported for this Unity WebGL content. Try installing Firefox, or press Ok if you wish to continue anyway.") || window.history.back()) : (alert("You need a browser which supports WebGL to run this content. Try installing Firefox."),
window.history.back());
}
function SetFullscreen(a) {
if ("undefined" == typeof JSEvents) return void console.log("Player not loaded yet.");
var b = JSEvents.canPerformEventHandlerRequests;
JSEvents.canPerformEventHandlerRequests = function() {
return 1;
module Rack
class GzipHeader
def initialize(app, options = {})
@app = app
@start_with = options[:start_with] || '/'
@end_with = options[:end_with] || '.gz'
end
def call(env)
@goosys
goosys / gzip.rb
Created August 26, 2016 19:42
CarrierWave::Gzip
module CarrierWave
module Gzip
extend ActiveSupport::Concern
module ClassMethods
def gzip_compress
process :gzip
end
end
@goosys
goosys / attributes.rb
Created August 19, 2016 08:56
[Rails]{ActiveRecord][PostgreSQL] sort columns
#
# config/initializers/extensions/active_record/attributes.rb
# https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/attributes.rb
#
module ActiveRecord #:nodoc:
module Attributes # :nodoc:
module ClassMethods
# Overriding method
def columns
@goosys
goosys / base.scss
Last active August 5, 2016 17:20
ActiveAdmin+Carrierwave
/**
* FileInput < Formtastic::Inputs::FileInput
*/
.attachment_wrap {
@extend p.inline-hints;
font-style: default;
display: block;
&.attachment_img img {
height: 80px;
@goosys
goosys / index.js
Created July 31, 2016 23:01
unzip_hook_from_s3
'use strict';
const aws = require('aws-sdk');
const s3 = new aws.S3({apiVersion: '2006-03-01'});
const node_zip = require('node-zip');
const mime = require('mime-types');
function lookup_mime( name ){
console.log(name);
const mimetype = mime.lookup(name) || 'application/octet-stream';
@goosys
goosys / development.rb
Created June 15, 2016 08:45
[Rails] environment tempate
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
@goosys
goosys / index.html
Last active August 29, 2015 14:23 — forked from anonymous/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style>
a .invisible {
font-size: 0;
line-height: 0;
}
@goosys
goosys / script.js
Created June 9, 2015 06:22
(jQuery) EnterでSubmitさせずにTab移動を行う(Shiftで逆戻り可)
<script>
$(document).ready(function(){
var elements = ":input[readonly!=readonly]";
$(elements).keypress(function(e) {
var c = e.which ? e.which : e.keyCode;
if (c == 13) {
var index = $(elements).index(this);
var criteria = e.shiftKey ? ":lt(" + index + "):last" : ":gt(" + index + "):first";
$(elements + criteria).focus();
e.preventDefault();