Skip to content

Instantly share code, notes, and snippets.

View krisdigital's full-sized avatar

Krisdigital krisdigital

View GitHub Profile
@krisdigital
krisdigital / gist:c4df0e77c9a1d52856c43486a157265f
Created January 1, 2019 21:11
Bundler Gem not Found Error
If you get this strange error:
Your bundle is locked to some_gem (0.10.1), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of some_gem
(0.10.1) has removed it. You'll need to update your bundle to a version other than some_gem (0.10.1) that hasn't been removed in order to install.
and running `ruby -ropen-uri -e 'eval open("https://git.io/vQhWq").read'` ends with no errors:
Check your time settings on your server/machine!
https://bundler.io/v1.17/guides/rubygems_tls_ssl_troubleshooting_guide.html
@krisdigital
krisdigital / yourtheme.theme
Created February 16, 2017 17:33
Drupal 8 - change view mode programmatically and consider cache
<?php
// If you do not add the cache key, you will get
// interesting results in your live environment
// where caching is enabled
function yourtheme_preprocess_node(&$vars) {
...
$textBl = $vars['content']['field_page'];
$delta = 0;
@krisdigital
krisdigital / Image.rb
Last active October 6, 2015 19:29
Rails Dragonfly delete unused files
class Image < ActiveRecord::Base
belongs_to :imageable, :polymorphic => true
dragonfly_accessor :image
validates_property :format, of: :image, in: ['jpeg', 'png', 'gif']
validates :image, presence: true
def self.cleanup
image_root = Dragonfly.app.datastore.root_path
@krisdigital
krisdigital / HelpViewController.m
Created August 6, 2015 07:51
Essential Lines to make a UIModalPresentationPopover work on iPhone / iOS 8.3
#import "HelpViewController.h"
@interface HelpViewController ()
@end
@implementation HelpViewController
-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
@krisdigital
krisdigital / gist:8363612
Created January 10, 2014 22:06
Several fixes for Bootstrap 3 Modals when using forms and iOS
//Modals, several fixes
$('.modal').on('show.bs.modal', function() {
$("#page input:not(:disabled), #page select:not(:disabled)").addClass('twerked').prop("disabled", true);
var measureScrollBar = function () {
var scrollDiv = document.createElement('div')
scrollDiv.style = 'width: 1px;height: 1px;overflow: scroll;position: absolute;top: -9999px;'
document.body.appendChild(scrollDiv)
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
document.body.removeChild(scrollDiv)