Skip to content

Instantly share code, notes, and snippets.

View nejdetkadir's full-sized avatar

Nejdet Kadir Bektaş nejdetkadir

View GitHub Profile
@nejdetkadir
nejdetkadir / update.rake
Last active December 21, 2021 17:52
fixer.io task for currencies rates
namespace :currency do
task :update do
uri = URI("http://data.fixer.io/api/latest")
params = { :access_key => ENV['FIXERIO_ACCESS_KEY'] }
uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
if res.is_a?(Net::HTTPSuccess)
body = JSON.parse(res.body)
@nejdetkadir
nejdetkadir / config.yml
Last active November 28, 2021 21:26
Circleci setup for Ruby on Rails application with RSpec & Rubocop.
version: 2.1
orbs:
ruby: circleci/ruby@1.0
node: circleci/node@2
jobs:
build:
docker:
- image: cimg/ruby:3.0.0-node
@nejdetkadir
nejdetkadir / config.yml
Last active November 7, 2023 18:55
Imagemagick support for circleci tests with rspec gem when using Ruby on Rails API application
version: 2.1
orbs:
ruby: circleci/ruby@1.0
node: circleci/node@2
jobs:
build:
docker:
- image: cimg/ruby:3.0.0-node # use a tailored CircleCI docker image.
steps:
@nejdetkadir
nejdetkadir / qrcode-generator.rb
Created August 8, 2021 15:04
How to generate qrcode with Ruby
require "rqrcode"
qrcode = RQRCode::QRCode.new("http://github.com/")
# NOTE: showing with default options specified explicitly
svg = qrcode.as_svg(
color: "000",
shape_rendering: "crispEdges",
module_size: 11,
standalone: true,
@nejdetkadir
nejdetkadir / Dockerfile
Last active May 6, 2021 05:04
Docker basics for Ruby on Rails
FROM ruby:3.0.0-alpine
RUN apk add --update --virtual \
runtime-deps \
postgresql-dev \
postgresql-client \
build-base \
libxml2-dev \
libxslt-dev \
nodejs \