Skip to content

Instantly share code, notes, and snippets.

View feldsam's full-sized avatar

Kristian Feldsam feldsam

View GitHub Profile
@feldsam
feldsam / gist:5d1a4010b1e83b621277c38dc48ee6f2
Created February 16, 2025 12:13
How to manage CentOS7 using Ansible with python3
# fix repositories
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
echo "sslverify=false" >> /etc/yum.conf
yum makecache fast
# install EPEL and SCL repo
yum install -y epel-release centos-release-scl
@feldsam
feldsam / observer.php
Last active September 7, 2020 16:41
Laravel Nova Manuall Action Dispatch
<?php
use Illuminate\Database\Eloquent\Collection;
use Laravel\Nova\Actions\DispatchAction;
use Laravel\Nova\Http\Requests\ActionRequest;
class ModelObserver
{
public function created(Model $model)
{
@feldsam
feldsam / jquery.type.js
Created June 6, 2012 11:06 — forked from johnboxall/jquery.type.js
For when you _really_ wanna change the type of a input with jQuery
var rtype = /^(?:button|input)$/i;
jQuery.attrHooks.type.set = function(elem, value) {
// We can't allow the type property to be changed (since it causes problems in IE)
if (rtype.test(elem.nodeName) && elem.parentNode) {
// jQuery.error( "type property can't be changed" );
// JB: Or ... can it!?
var $el = $(elem);
var insertionFn = 'after';