Skip to content

Instantly share code, notes, and snippets.

View devkinetic's full-sized avatar
🏠
Working from home

Ryan Hartman devkinetic

🏠
Working from home
View GitHub Profile
@devkinetic
devkinetic / .gitlab-ci.yml
Created December 1, 2020 16:15
Publish tagged release to Gitlab CI for Composer
stages:
- deploy
deploy:
only:
- tags
stage: deploy
script:
- 'curl --header "Job-Token: $CI_JOB_TOKEN" --data tag=$CI_COMMIT_TAG "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/composer"'
@devkinetic
devkinetic / _default-variables.scss
Created May 4, 2020 17:15
Backport Bootstrap 4 spacing classes to Bootstrap 3 SASS/SCSS
//== Spacing
//
$grid-breakpoints: (
xs: 0,
sm: $screen-sm-min,
md: $screen-md-min,
lg: $screen-lg-min
);
$spacer-x-0: 0rem;
$spacer-y-0: 0rem;
@devkinetic
devkinetic / MYMODULE.views_execution.inc
Last active March 18, 2020 14:52
Drupal 8 Contextual Filter IS NULL via hook_views_query_alter()
<?php
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\query\QueryPluginBase;
/**
* Implements hook_views_query_alter().
*
* @param ViewExecutable $view
* @param QueryPluginBase $query
@devkinetic
devkinetic / A-simpleSAMLphp-drupal-integration.md
Last active March 6, 2020 15:00
Integrating simpleSAMLphp into a composer managed project

Integrating simpleSAMLphp into a composer managed project

The following steps will provide a manageable solution for simpleSAMLphp in a composer project.

1. Add the script to project

Copy ScriptHandler.php file into scripts/simplesamlphp/ folder of your project (I'm using drupal-composer project)

2. Edit composer.json

Add class to the classmap

@devkinetic
devkinetic / varbase-updater.sh
Created April 30, 2019 19:52
Migration to tput support
#!/bin/bash
if [ -t 1 ] && command -v tput > /dev/null; then
# see if it supports colors
ncolors=$(tput colors);
if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then
bold="$(tput bold || echo)";
normal="$(tput sgr0 || echo)";
black="$(tput setaf 0 || echo)";
red="$(tput setaf 1 || echo)";
@devkinetic
devkinetic / Gruntfile.js
Last active August 19, 2016 07:56
Sass / Grunt - D8 theme
module.exports = function (grunt) {
"use strict";
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
prod: {
options: {
@devkinetic
devkinetic / application.rb
Last active July 1, 2016 17:50
Rails 4 static site generation
# config/application.rb
module AssetsInitializers
class Railtie < Rails::Railtie
initializer "assets_initializers.initialize_rails",
:group => :assets do |app|
require "#{Rails.root}/config/initializers/sprockets_patch.rb"
end
end
@devkinetic
devkinetic / _animation.scss
Last active January 28, 2016 21:21 — forked from greypants/gist:3185028
SCSS: keyframe mixins
// ======================================================================
// Animation.scss
// - Contains helpers for keyframes animation in css3
// - Only functionally with Sass 3.2.0 Alpha and Compass 0.13.alpha
// ======================================================================
@mixin animation($name) {
-webkit-animation: #{$name};
-moz-animation: #{$name};
-ms-animation: #{$name};
@devkinetic
devkinetic / home_controller.rb
Last active November 2, 2015 16:30
Template missing when two validations fail
Template is missing
Missing template registrants/index, application/index with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :arb, :jbuilder]}. Searched in: * "/home/ubuntu/workspace/backend-dev-test-devkinetic/app/views" * "/usr/local/rvm/gems/ruby-2.2.2/gems/html5-rails-0.1.0/app/views" * "/usr/local/rvm/gems/ruby-2.2.2/gems/devise-3.4.1/app/views" * "/usr/local/rvm/gems/ruby-2.2.2/bundler/gems/activeadmin-8968efcc51cc/app/views" * "/usr/local/rvm/gems/ruby-2.2.2/gems/kaminari-0.16.3/app/views"
Extracted source (around line #46):
def find(*args)
find_all(*args).first || raise(MissingTemplate.new(self, *args))
end
def find_all(path, prefixes = [], *args)