Skip to content

Instantly share code, notes, and snippets.

View 6temes's full-sized avatar
😏
I have a plan

Daniel 6temes

😏
I have a plan
View GitHub Profile
@6temes
6temes / includes_current_attributes.rb
Created February 8, 2024 03:52
Pass Current attributes to Good Job
#
# Injects the Current attributes into the job arguments automatically when enqueuing
# and sets the Current attributes from the job arguments when performing.
# For testing, you can pass the current attributes as the last argument to `perform_later`:
#
# MyJob.perform_later(arg1, arg2, _current_attributes: { person: person, trust: trust })
#
# This will set the Current attributes to the given values when performing the job.
#
# If you want to set the Current attributes when enqueuing the job, include this module in your job class:
@6temes
6temes / rails-tests.yml
Last active June 8, 2021 21:29
Github actions setup with Rspec and static code analysis for Ruby on Rails
env:
PGHOST: localhost
PGPASS: runner
PGUSER: runner
RAILS_ENV: test
DATABASE_URL: postgresql://runner:runner@localhost
name: Rails Tests
on: [push, pull_request_review]
@6temes
6temes / senior_front_end.md
Created March 17, 2020 02:25
Full Remote Senior Front End needed

Looking for a fully-remote front-end developer

The Company

Fundbook is a next-generation M&A matching service that revolutionizes the current M&A’s market. Fundbook helps investors to find the best deals and company owners find successors with matching corporate philosophy.

The Team

We are a growing multinational team developing a matchmaking platform for the M&A market.

@6temes
6temes / array_validator.rb
Created October 2, 2019 04:23
Validates that only allowed values are added to an array field.
# frozen_string_literal: true
class ArrayValidator < ActiveModel::EachValidator
ERROR_MESSAGE = 'An array must be supplied in the :is_subset_of option ' \
'of the configuration hash'
def validate_each(record, attribute, value)
return unless value.is_a? Array
return if (value - other).empty?
import Qs from 'qs'
import axios from 'axios'
import axiosMiddleware from 'redux-axios-middleware'
import decamelizeKeysDeep from 'decamelize-keys-deep'
import jsifyKeysDeep from 'jsify-case-keys-deep' // Like `camelcase-keys-deep` but also transforms suffix '?' with prefix `is`
const axiosMiddlewareConfig = {
interceptors: {
request: [
(_, request) => {
import axios from 'axios'
import jsifyKeysDeep from 'jsify-case-keys-deep' // Like `camelcase-keys-deep` but also transforms suffix '?' with prefix `is`
import decamelizeKeysDeep from 'decamelize-keys-deep'
import Qs from 'qs'
export default (baseURL) => {
const axiosClient = axios.create({
baseURL,
responseType: 'json',
})

Keybase proof

I hereby claim:

  • I am 6temes on github.
  • I am 6temes (https://keybase.io/6temes) on keybase.
  • I have a public key ASDQ3JtZQs2FAPh593JvNYjCYaF6wzf338vY-O_mCUKlUgo

To claim this, I am signing this object:

@6temes
6temes / heroku_env_copy.sh
Created April 13, 2017 02:15 — forked from nabucosound/heroku_env_copy.sh
Script to copy environment variables from an existing heroku app to another one
#!/bin/bash
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/
set -e
sourceApp="$1"
targetApp="$2"
while read key value; do
@6temes
6temes / mysql_downgrade.txt
Last active October 28, 2024 01:07
Downgrade MySQL version with brew
# Kill rails server and guard
bin/spring stop
brew services stop mysql
brew uninstall mysql
brew install [email protected]
brew link [email protected] --force
brew services start [email protected]
rbenv uninstall 2.3.3
rbenv install 2.3.3
gem install bundle
@6temes
6temes / fb_sdk.js
Last active October 22, 2019 18:38
Compatibility between Facebook Plugin and Turbolinks 5
// FacebookSDK
// https://developers.facebook.com/docs/plugins/page-plugin/
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk')); // Replace 'facebook-jssdk' with your page id.