Skip to content

Instantly share code, notes, and snippets.

View achmiral's full-sized avatar
🏠
WFH

Miral Achmed achmiral

🏠
WFH
View GitHub Profile
@achmiral
achmiral / shell.md
Created November 9, 2018 16:59 — forked from SunDi3yansyah/shell.md
MySQL / MariaDB login without SUDO
$ > sudo mysql -uroot
mysql > SELECT User, Host FROM mysql.user;
mysql > DROP USER 'root'@'localhost';
@achmiral
achmiral / application.html.erb
Created November 9, 2018 16:59 — forked from SunDi3yansyah/application.html.erb
Each :notice :error :alert helper
<% [:notice, :error, :alert].each do |level| %>
<% unless flash[level].blank? %>
<div data-alert="alert" class="alert alert-<%= flash_class(level) %> fade in">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<%= content_tag :p, flash[level] %>
</div>
<% end %>
<% end %>
@achmiral
achmiral / manu-active-with.js
Created November 10, 2018 06:02 — forked from SunDi3yansyah/manu-active-with.js
Menu Active with JS
var url = window.location;
var element = $(".ui.vertical.menu a.item").filter(function() {
return this.href == url || url.href.indexOf(this.href) == 0;
}).addClass("active").parent().parent().parent();
if (element.is("li")) {
element.addClass("active");
}

The JSON API Standard

What is the JSON API Standard

The Specification

  • The History
  • Why does it exist?
    • Bike Shedding/LookingFor
  • Do we have to use it?
@achmiral
achmiral / Gemfile
Created June 25, 2020 06:21 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@achmiral
achmiral / creative-cloud-disable.md
Created February 12, 2022 08:04 — forked from andreibosco/creative-cloud-disable.md
disable creative cloud startup on mac
@achmiral
achmiral / dropzone_controller.js
Created March 24, 2023 05:21 — forked from lazaronixon/_form.html.erb
Dropzone.js + Stimulus + Active Storage
import { Controller } from "stimulus"
import { DirectUpload } from "@rails/activestorage"
import Dropzone from "dropzone"
import { getMetaValue, findElement, removeElement, insertAfter } from "helpers"
Dropzone.autoDiscover = false
export default class extends Controller {
static targets = [ "input" ]