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 / README.md
Created November 9, 2018 16:50 — forked from SunDi3yansyah/README.md
Make /robots.txt aware of the Rails environment

Make /robots.txt aware of the Rails environment

You probably don't want Google crawling your development staging app. Here's how to fix that.

$ mv public/robots.txt config/robots.production.txt
$ cp config/robots.production.txt config/robots.development.txt

Now edit config/routes.rb to add a route for /robots.txt, and add the controller code.

@achmiral
achmiral / .gitlab-ci.yml
Created November 9, 2018 16:50 — forked from SunDi3yansyah/.gitlab-ci.yml
Example Gitlab CI Config for a Rails + Nginx application using Docker Compose
# See how variables work, and a list of predefined ones:
# - https://docs.gitlab.com/ce/ci/variables/
variables:
RAILS_IMAGE: registry.gitlab.com/bryanbraun/gridmaster.io/railsapp:$CI_COMMIT_SHA
NGINX_IMAGE: registry.gitlab.com/bryanbraun/gridmaster.io/nginx:$CI_COMMIT_SHA
DEPLOY_TAG: $CI_COMMIT_SHA
cache:
paths:
- vendor/ruby
class Api::RegionsController < ApplicationController
def provinces
prompt = [
{
id: "",
name: core_model_lang("province")
}
]
@provinces = prompt + Province.all
render json: @provinces.to_json(only: [:id, :name])
@achmiral
achmiral / .vimrc
Created October 29, 2018 04:48
My Vim Configuration
" Setup Vim Core
set number "Nomor Baris Statik
set relativenumber "Nomor Baris Dinamik
set nocompatible
set softtabstop=2
set backspace=indent,eol,start
filetype plugin indent on
set laststatus=2
set linespace=3
@achmiral
achmiral / missing_num_array.rb
Created October 16, 2018 12:18 — forked from malchak/missing_num_array.rb
Solutions to Find Missing Number in Array.
# Question:
# Suppose you have an array of 99 numbers.
# The array contains the digits 1 to 100 with one digit missing.
# Write four different algorithms to compute the missing number.
# Two of these should optimize for low storage and two of these should optimize for fast processing.
# (Keep in mind, there are no duplicates and the array is not already sorted.)
#######################################################
@achmiral
achmiral / rails-singular-or-plural.md
Created July 24, 2018 03:53 — forked from SunDi3yansyah/rails-singular-or-plural.md
Rails Conventions - Singular or Plural?
Name Singular/Plural Use
Controller Plural rails g controller Users index show
Helper Plural rails g helper Users
Mailer Singular rails g mailer UserMailer
Migration Plural rails g migration AddEmailToUsers email:string
Model Singular rails g model User name:string
Observer Singular rails g observer User
Resource Plural* resources :users, :only => [:index, :show]
Scaffold Singular rails g scaffold User name:string
@achmiral
achmiral / Dockerfile
Created September 26, 2017 04:39 — forked from sidwood/Dockerfile
Node.js dockerfile templates
FROM node:7.10-alpine
RUN mkdir -p /opt/app
WORKDIR /opt/app
COPY ./package.json /opt/app
RUN apk add --update --no-cache tini &&\
apk add --virtual .build-dependencies make gcc g++ python &&\
npm install --production &&\
@achmiral
achmiral / gist:7995b056dd1b47802279cd65ea69d787
Created September 14, 2017 16:22 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@achmiral
achmiral / hosts
Created May 8, 2017 15:46 — forked from mul14/00_etc-hosts.md
/etc/hosts for Vimeo and Reddit
# ---------------------------------------------------
# Vimeo
# ---------------------------------------------------
104.156.85.217 vimeo.com
23.214.58.223 secure-c.vimeocdn.com
74.113.233.128 developer.vimeo.com
23.235.43.143 i.vimeocdn.com
23.235.43.143 f.vimeocdn.com
80.239.137.98 a.vimeocdn.com
@achmiral
achmiral / markup
Created May 5, 2017 12:19 — forked from petehouston/markup
[Bootstrap] Text overlay center inside the image
<div class="row" id="box-search">
<div class="thumbnail text-center">
<img src="img/cafe.jpg" alt="" class="img-responsive">
<div class="caption">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab, quisquam?</p>
</div>
</div>
</div>