Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Berthier KevinBerthier

View GitHub Profile
@nathanhleung
nathanhleung / FIX-MACOS-HANG.md
Last active Jan 23, 2021
Fix macOS Hanging Issue
View FIX-MACOS-HANG.md

Fix macOS Hanging Issue

Problem

Hey Apple users:

If you're now experiencing hangs launching apps on the Mac, I figured out the problem using Little Snitch.

It's trustd connecting to http://ocsp.apple.com

@dhh
dhh / Gemfile
Created Jun 24, 2020
HEY's Gemfile
View 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
@rhythnic
rhythnic / vuex-reusable-functions.js
Last active Aug 19, 2020
Reusable Vuex Functions
View vuex-reusable-functions.js
// *******************************************************************
// ATTENTION
// This gist is now an npm module
// The API of some functions is altered slightly.
// All future work will happen in the repo.
//
// https://gitlab.com/rhythnic/vuex-intern
// *******************************************************************
// *******************************************************************
@mrmartineau
mrmartineau / stimulus.md
Last active Oct 15, 2021
Stimulus cheatsheet
View stimulus.md
@nerdcave
nerdcave / environment.js
Last active May 11, 2021
PurgeCSS config for Rails 5 and Webpacker (along with Tailwind CSS and Vue.js, in this case)
View environment.js
// first run:
// yarn add glob-all purgecss-webpack-plugin --dev
/*
config/webpack/environment.js
PurgeCSS configuration for Rails 5 + Webpacker + Tailwind CSS + Vue.js
Optionally, put this in production.js if you only want this to apply to production.
For example, your app is large and you want to optimize dev compilation speed.
*/
View trix_color_attributes.coffee
getHexColor = (color) ->
return "" unless color
return color if /^#/.test(color)
rgbValues = getRGBValues(color)
hexValues = rgbValues.map(numberToHex)
"#" + hexValues.join("")
numberToHex = (number) ->
"0#{number.toString(16)}".slice(-2).toUpperCase()
@przbadu
przbadu / _vue-rails.md
Last active Jul 30, 2021
Vue js and Rails integration
View _vue-rails.md

Setup Rails and Vuejs

  1. Generate new rails app using --webpack flag
rails new myApp --webpack=vue

Note:

  1. You can use --webpack=angular for angular application and --webpack=react for react.
@DmytroLukianov
DmytroLukianov / capistrano_rails_console.rb
Created Jul 27, 2017
Rails console for capistrano and rbenv
View capistrano_rails_console.rb
namespace :rails do
desc "Open the rails console"
task :console do
on roles(:app) do
rails_env = fetch(:rails_env, 'production')
execute_interactively "$HOME/.rbenv/bin/rbenv exec bundle exec rails console #{rails_env}"
end
end
desc "Open the rails dbconsole"
@martinrisseeuw
martinrisseeuw / correct.vue
Last active Jun 2, 2020
Mapbox Nuxt component
View correct.vue
<template>
<div id="map" class="map">
<div class="button-bar">
<button v-on:click="addMapLayer()">terrain</button>
</div>
</div>
</template>
<script>