Skip to content

Instantly share code, notes, and snippets.

@bl4ck5un
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017 03:20
Responsive helpers (mobile-only etc.) for semantic-ui
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
@jnewman12
jnewman12 / Forms.md
Last active November 3, 2023 15:36
Forms, form_for, link_to lesson

Forms, form_for, and link_to


Lesson Objectives

  1. Understand forms and the ways we write them
  2. Understand the difference between form_tag and form_for
  3. Understand link_to and how we can use it to dynamically link our application together
@SunDi3yansyah
SunDi3yansyah / List-of-Rails-Status-Code-Symbols.md
Created November 28, 2016 17:51
List of Rails Status Code Symbols

1xx Informational

Status Code Status Message Symbol
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing

2xx Success

Status Code Status Message Symbol
@Bradcomp
Bradcomp / toggle-menu.js
Created September 3, 2016 00:08
Toggles the .is-active class for a hamburger menu
(function() {
var burger = document.querySelector('.nav-toggle');
var menu = document.querySelector('.nav-menu');
burger.addEventListener('click', function() {
burger.classList.toggle('is-active');
menu.classList.toggle('is-active');
});
})();
@wicky-andrian
wicky-andrian / gist:edc8167de82af9ac1cb0
Last active January 15, 2016 23:52
Selamat Pagi Dunia.rb
Cred distillery kale chips migas wolf. Listicle tattooed iPhone, synth vice squid ethical meditation cred. 8-bit lumbersexual drinking vinegar brunch. Literally austin authentic lumbersexual sriracha cold-pressed YOLO. Organic vinyl meggings messenger bag, bitters gastropub occupy meditation leggings jean shorts direct trade selvage. Crucifix iPhone fanny pack bushwick, roof party actually banh mi meggings. Synth pinterest church-key, waistcoat thundercats PBR&B gluten-free ugh tumblr before they sold out kale chips YOLO.
Venmo wolf literally keytar, blue bottle wayfarers sartorial cred raw denim aesthetic helvetica. Vegan poutine PBR&B food truck, pour-over schlitz vice post-ironic venmo. Raw denim chicharrones PBR&B, letterpress ethical salvia pour-over 3 wolf moon migas chia drinking vinegar listicle literally. YOLO ugh plaid tilde, hoodie DIY offal wolf farm-to-table hammock kogi williamsburg vegan. Seitan shoreditch intelligentsia kale chips letterpress austin. 90's salvia polaroid, ugh YOLO cliche pick
@wicky-andrian
wicky-andrian / _navdropdown.html.haml
Created November 18, 2015 14:20
navbar dropdown for Haml
%nav.navbar.navbar-default{role: "navigation"}
/ Brand and toggle get grouped for better mobile display
.navbar-header
%button.navbar-toggle{"data-target" => ".navbar-ex1-collapse", "data-toggle" => "collapse", type: "button"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand{href: "#"} Brand
/ Collect the nav links, forms, and other content for toggling
@rwarbelow
rwarbelow / running_app_in_production_locally.markdown
Created November 11, 2015 18:26
How to Run a Rails App in Production Locally
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

@wicky-andrian
wicky-andrian / Issue about Rails 4.2.4 Make sure that `gem install mysql2 -v '0.4.1'`
Created November 8, 2015 17:57
About Issue Mysql2 cannot bundle install in rails -v 4.x.x
do it ..
gem 'mysql2', '~> 0.3.18' this gem works with rails version 4.x.x
if install gem 'mysql2', '~> 0.4.0' it produces gem load error
referense
https://github.com/rails/rails/issues/21544
@SunDi3yansyah
SunDi3yansyah / pwl.php
Created October 12, 2015 17:06
Tugas Pemrograman Web Lanjut {M. Rudyanto Arief, MT}
<?php
$nilai_angka = 85;
$mata_kuliah = 'Pemrograman Web Lanjut';
if ($nilai_angka > 80) {
$nilai_huruf = 'A';
$ket = 'Lulus';
} elseif ($nilai_angka > 60) {
$nilai_huruf = 'B';
$ket = 'Lulus';
} elseif ($nilai_angka > 50) {
@wendygwo
wendygwo / Adding 'Forgot Password' to login page.md
Last active February 21, 2022 14:03
How to add 'Forgot password' to a Rails app that's using bcrypt for authentication

Credit:

All the steps below came from watching the Railscast below:

http://railscasts.com/episodes/274-remember-me-reset-password

The steps below assumes that your app already has a user and user authentication set up.

  • Add to app/views/sessions/new.html.erb file
<p><%= link_to 'Forgot password?', new_password_reset_path %></p>