Skip to content

Instantly share code, notes, and snippets.

View PikachuEXE's full-sized avatar

PikachuEXE PikachuEXE

View GitHub Profile
PikachuEXE / placeholder.js
Created April 26, 2013 04:55
jQuery HTML5 placeholder fix Written in CoffeeScript and converted into JavaScript later This is supposed to deal with dynamically loaded elements Not tested though
* This hack creates the placeholder effect on old browsers
* Source:
* Dependency: jQuery & Modernizr
* It also add a class to the input so you can style it to look like normal placeholder
jQuery(function($) {
PikachuEXE /
Created April 26, 2013 05:01
Toggleable Just a small style and a script file to toggle display content (on/off)
jQuery ($) ->
$(document).on "click", '.js-toggleable-container', ->
PikachuEXE / hoverable.scss
Created April 26, 2013 05:04
Hoverable Similar to Toggleable But this one does not require script
// This class use direct selector '>' since you might want to use it nested way
// Like hover menu, then hover button
.hoverable-container {
& > .hoverable-content.on-hover {
display: none;
&:hover {
// Hide the default one
PikachuEXE /
Created April 26, 2013 05:13
Toggle Display A small JavaScript to toggle display of target element(s)
Toggle Display
Put the data attributes on a button or link
Required attributes:
data-toggle: 'display'
data-target: selector of target element
Optional attibutes:
data-effect: 'slide', 'fade', other values (no effect)
PikachuEXE / check_for_memcached.rb
Last active December 21, 2015 12:19 — forked from subelsky/check_for_memcached.rb
Use memcached as cache store on development if it is running
# Use a different cache store based on memcached is running or not
# check if memcached is running; if it is, use that instead of the default memory cache
Timeout.timeout(0.5) {"localhost", 11211) { } }
config.cache_store = :dalli_store, %w(localhost:11211), {namespace: Rails.application.class.parent_name, expires_in:, compress: true}
$stderr.puts "Using memcached on localhost:11211"
rescue StandardError
$stderr.puts "memcached not running, caching to memory"
# SO:
module Routing
extend ActiveSupport::Concern
include Rails.application.routes.url_helpers
included do
def default_url_options
{ :locale => I18n.locale }
PikachuEXE / default_params.rb
Last active January 1, 2016 07:09
The monkey patch to apply default parameters/default_url_options in RSpec (Rails 4 only)
require 'active_support/concern'
module DefaultParams
extend ActiveSupport::Concern
included do
let(:default_params) { {locale: I18n.locale} }
def process_with_default_params(action, http_method = 'GET', *args)

Keybase proof

I hereby claim:

  • I am pikachuexe on github.
  • I am pikachuexe ( on keybase.
  • I have a public key ASC32BMYJZ9ooOBpy6iF2ViTy_BzRD4QsY9kY4uL2mevSgo

To claim this, I am signing this object:

PikachuEXE / Dockerfile.app_image
Created September 14, 2018 01:37
2 stage rails app docker image building
FROM user/baseimage:version-tag
# 1. This is VERY basic
# 2. Need to load RVM first during build
# 3. Create empty folders for runtime files
rm /bin/sh && ln -s /bin/bash /bin/sh && \
mkdir -p \
/home/app/webapp \
PikachuEXE / # elasticsearch - 2018-10-05_09-04-53.txt
Created October 5, 2018 02:23
elasticsearch on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for elasticsearch on macOS 10.13.6
Build date: 2018-10-05 09:04:53