Skip to content

Instantly share code, notes, and snippets.

View lazyguru's full-sized avatar

Joe Constant lazyguru

View GitHub Profile
@Nitrousoxide
Nitrousoxide / lemmyfollowbookmarklet
Last active June 29, 2023 09:02
Lemmy Follow Bookmarklet
javascript:(function() {
var currentUrl = window.location.href;
var instanceUrl = 'https://beehaw.org'; /*replace this with your local instance's URL with no ending '/' */
var communitySlug = currentUrl.split('/c/')[1];
var originalUrl = currentUrl.split('/')[2];
var subscribeUrl = instanceUrl + '/c/' + communitySlug + '@' + originalUrl;
window.location.href = subscribeUrl;
})();

How to install Homebrew package manager on Steam Deck

(See also installing Distrobox: https://distrobox.it/ )
(See also installing Nix package manager: https://determinate.systems/posts/nix-on-the-steam-deck )

You can install Homebrew (a package manager for macOS and Linux) without disabling the read-only partition with sudo steamos-readonly disable.
The package manager can be used alongside Flatpaks. Some software is only available on Flathub, and some software is only available on Homebrew.

  1. Switch to desktop mode (hold power button until a menu appears, then select "Switch to desktop mode")
  2. Click the logo at the bottom left, go to System, then go to Konsole
@tobi
tobi / kindle.rb
Last active September 25, 2022 02:37
Download your Kindle Highlights to local markdown files. Great for Obsidian.md.
#!/usr/bin/env ruby
# gem install active_support
require 'active_support/inflector'
require 'active_support/core_ext/string'
# gem install webrick (only ruby3)
require 'webrick'
# gem install mechanize
@josephmancuso
josephmancuso / README.md
Last active April 21, 2020 06:28
Deploy a Masonite application through a GitHub action

Instructions

This is a gist containing several files needed to get Masonite automatically deploying to your servers via GitHub pushes (or releases)

NOTE: This script will have a downtime of a few seconds between deployments. If your application requires no downtime you can see this GIST here for a bit more complex GIST for getting to zero downtime deployments through the use of uWSGI, unix sockets and managed config files

Requirements

  • NGINX installed (may or may not be fully configured)
  • Python 3 installed and everything needed to run a Masonite application (see Masonite documentation for requirements)
@JeffreyWay
JeffreyWay / AppServiceProvider.php
Last active November 6, 2021 11:51
Laracasts Widgets Lesson
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
// Add this to the "boot()" method of your "AppServiceProvider"
<?php
\Illuminate\Database\Eloquent\Builder::macro('search', function ($name, $search) {
return $this->where($name, 'LIKE', $search ? '%'.$search.'%' : '');
});
@TravisBernard
TravisBernard / allthethings.sh
Last active August 18, 2018 21:12
Clean all the things (M2)
#!/bin/bash
# Derived from
# https://github.com/btford/allthethings
#
# Licensed under WTFPL http://sam.zoy.org/wtfpl/
#
pur=$(tput setaf 5) # Purple
@adamwathan
adamwathan / vue.sublime-snippet
Created February 5, 2018 20:24
Vue Component Snippet for Sublime
<snippet>
<content><![CDATA[
<template>
${0}
</template>
<script>
export default {
props: [${1}],
data() {