Skip to content

Instantly share code, notes, and snippets.

View AstmDesign's full-sized avatar
😀
Converting coffee to code

Astm AstmDesign

😀
Converting coffee to code
View GitHub Profile
@AstmDesign
AstmDesign / actors_controller.rb
Last active March 23, 2020 18:41
Simple Movies Ruby on rails application
class ActorsController < ApplicationController
before_action :set_actor, only: %i[show edit update destroy]
# GET /actors for current user
def index
# Allow searing by name or bio
@actors = Actor.search(params).page(params[:page])
end
# GET /actors/1
def show; end
@AstmDesign
AstmDesign / fix-libv8-mac.txt
Created February 14, 2020 07:44 — forked from fernandoaleman/fix-libv8-mac.txt
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@AstmDesign
AstmDesign / bitbucket-pipelines.yml
Created December 9, 2019 12:40 — forked from jean182/bitbucket-pipelines.yml
Bitbucket Pipelines example
image: starefossen/ruby-node:2-5
pipelines:
branches:
master:
- step:
script:
- export HEROKU_APP_NAME=ci-conceptual
- chmod +x deploy-scripts/package_and_deploy.sh deploy-scripts/migrate.sh deploy-scripts/restart.sh
- deploy-scripts/package_and_deploy.sh
@AstmDesign
AstmDesign / Bitbucket Pipeline Rails.yml
Created December 9, 2019 11:38 — forked from isseu/Bitbucket Pipeline Rails.yml
To run rails with bitbucket pipeline CI
# This is a sample build configuration for Ruby.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: ruby:2.2.4
clone:
depth: 3
@AstmDesign
AstmDesign / custom_ruby_version_workflow.yml
Created November 26, 2019 10:54
Github actions to run Ruby on rails Tests with custom Ruby version
name: Rails Tests with custom Ruby version
# on: [push, pull_request]
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-16.04
@AstmDesign
AstmDesign / get_cursor_position.html
Last active November 20, 2019 09:39
get cursor position
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>get position</title>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
@AstmDesign
AstmDesign / css variables
Created November 6, 2019 09:15
Using css variables
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Css Variables</title>
<style>
.c-avatar {
@AstmDesign
AstmDesign / workflow.yml
Created September 17, 2019 14:12
Github actions for rails applications
name: Main
on: [push]
jobs:
vm-job:
runs-on: ubuntu-16.04
services:
postgres:
image: postgres:10.8
@AstmDesign
AstmDesign / main.yaml
Created September 17, 2019 07:20 — forked from ArturT/main.yaml
GitHub Actions - how to run parallel tests in RSpec for Ruby on Rails project. See article how to run RSpec on GitHub Actions for Ruby on Rails app using parallel jobs https://docs.knapsackpro.com/2019/how-to-run-rspec-on-github-actions-for-ruby-on-rails-app-using-parallel-jobs or sign up at https://knapsackpro.com/?utm_source=github&utm_medium=…
# .github/workflows/main.yaml
name: Main
on: [push]
jobs:
vm-job:
runs-on: ubuntu-latest
# If you need DB like PostgreSQL then define service below.
@AstmDesign
AstmDesign / install_rails_5.sh
Last active August 28, 2019 11:28
Install Rails 5.2.2 & Ruby 2.5.3 on Ubuntu 16.04 server
#!/bin/bash
#
# Install Rails 5.2.2 & Ruby 2.5.3 server environment
# Created by Astm Ali | https://github.com/astmdesign
#
clear
echo "$(tput setaf 201)--------------------------------"
echo "Install Rails 5.2.2 & Ruby 2.5.3 server environment As $(whoami) user"