Skip to content

Instantly share code, notes, and snippets.

View mhackersu's full-sized avatar
🐧
tokimeku

Mike Hacker mhackersu

🐧
tokimeku
View GitHub Profile
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with the same name as the keys in <tt>filtering_params</tt>
# with their associated values. Most useful for calling named scopes from
@mhackersu
mhackersu / active-record-migration-expert.md
Last active August 29, 2015 14:26 — forked from pyk/active-record-migration-expert.md
become active record migration expert (Rails 4.0.2)

become active record migration expert (Rails 4.0.2)

workflow:

create model

$ rails g model NameOfModel
    invoke  active_record
    create    db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb
@mhackersu
mhackersu / SassMeister-input-HTML.html
Created April 28, 2016 04:58 — forked from mirisuzanne/SassMeister-input-HTML.html
Susy One Tutorial: Mobile-First Magic Grids [part 2]
<div class="page">
<header class="banner">
<p>Banner</p>
</header>
<nav class="pagenav">
<p><a href="#">Page Nav</a></p>
</nav>
<main class="main">
<aside class="summary">
<p>Summary</p>
@mhackersu
mhackersu / Color-Schemer.markdown
Last active October 16, 2019 22:13
Color-Schemer
@mhackersu
mhackersu / a-birthday-cake-for-karynecia.markdown
Last active October 16, 2019 22:12
A Birthday cake for Karynecia
@mhackersu
mhackersu / basic-accordations.markdown
Created August 10, 2017 19:57
Basic Accordations

CSS Grid

@mhackersu
mhackersu / Dokku.sh
Created September 27, 2017 04:08 — forked from didierfranc/Dokku.sh
Get Dokku working with Ubuntu 16.04 LTS
sudo sh -c "
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
echo 'deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main' | tee /etc/apt/sources.list.d/dokku.list
apt-get update -qq > /dev/null
apt-get install sigil -t trusty # We're using the Ubuntu 14.04 package ;)
apt-mark hold sigil
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh
bash bootstrap.sh
"
@mhackersu
mhackersu / index.html
Created October 5, 2017 18:55
JS Bin [es6-fetch] // source https://jsbin.com/hanimif
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[es6-fetch]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
background: #f5f5f5;