Skip to content

Instantly share code, notes, and snippets.

View Natetronn's full-sized avatar

Nathan Doyle Natetronn

View GitHub Profile
@mjtiempo
mjtiempo / x0vncserver.service
Created November 24, 2022 02:42
TigerVNC systemd service using sddm on kde plasma
[Unit]
Description=Remote desktop service (VNC) for :0 display
Requires=display-manager.service
After=network-online.target
After=display-manager.service
[Service]
Type=simple
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment XAUTHORITY=$(find /var/run/sddm/ -type f)"
Environment=HOME=/root
@tin2tin
tin2tin / basic_ui_documented.py
Last active April 10, 2024 03:38 — forked from AzureDVBB/basic_ui_documented.py
A commented template for making simple UI in blender using the bpy python API
#import the bpy module to access blender API
import bpy
#WARNING: this is written and tested for blender 2.79
#blender 2.8 and newer will likely have a different python API
#create a property group, this is REALLY needed so that operators
#AND the UI can access, display and expose it to the user to change
#in here we will have all properties(variables) that is neccessary
class CustomPropertyGroup(bpy.types.PropertyGroup):
@khalwat
khalwat / BradsForMen.conf
Last active January 1, 2020 01:10
How to avoid .htaccess completely, and put your rewrite rules for Craft CMS in an Apache .conf file
# Using .htaccess is something you should avoid if at all possible, due to performance concerns:
# https://httpd.apache.org/docs/current/howto/htaccess.html
# Here's how to implement the rewrite rules for CraftCMS in an Apache .conf file; the key
# part is the "## Removes index.php from Craft URLs ##" section; the rest is provided
# just for context. Enjoy - andrew@nystudio107.com
<VirtualHost *:80>
ServerName BradsForMen.com
ServerAlias *.BradsForMen.com
DocumentRoot /var/www/BradsForMen/public
@khalwat
khalwat / set-project-perms.sh
Last active January 1, 2020 01:10
Properly set permissions for a Craft CMS install, including ensuring that files are all g-x. Set CHOWN_USER, CHOWN_GROUP, and BASE_DIR to whatever is appropriate, add directories that need to be writeable by the web server to DIRS[], then execute: sudo ./set-project-perms.sh PROJECT_NAME
This is now part of craft-scripts:
https://github.com/nystudio107/craft-scripts
@Pysis868
Pysis868 / grub.cfg
Last active February 25, 2024 06:41
My own configuration file for GRUB2 to boot various live distributions of Linux-based operating systems, along with some system tools. I tried to include a lot of sample configuration entries, even if I don't currently use them, so it may help others. Exceedingly long blog post: http://tehfishyblog.logdown.com/chips/306146-a-homemade-ultimate-bo…
# Config for GNU GRand Unified Bootloader (GRUB) (2)
# /boot/grub2/grub.cfg
# or
# /boot/grub/grub.cfg
# Mostly only 'legacy' CSM/BIOS boot methods currently.
# Unable to boot loop entries with Secure Boot
# Notes:
# Description:
# This grub.cfg file was created by Lance http://www.pendrivelinux.com
@jmuspratt
jmuspratt / Craft CMS: Video Block
Last active August 29, 2015 14:21
Assume we're in a Matrix field called postBody which contains different kinds of blocks. videoBlock has three fields: (1) a dropdown for videoService (youtube vs. vimeo), (2) a dropdown for videoAspectRatio (ratio-16-9, ratio-4-3, etc.), and (3) a text field for videoID.
{% if entry.postBody | length %}
<div class="post-body">
{% for block in entry.postBody %}
{% switch block.type %}
{% case 'textBlock' %}
{{ block.text }}
{# cases for other blocks #}
@alexroper
alexroper / matrix-slideshow-example.twig
Created April 22, 2015 17:35
Slideshow with mixed matrix blocks in Craft CMS
{#
# Example of building a slideshow in Craft from adjacent matrix blocks.
#
# This is a technique for getting around the problem of not being able to nest
# matrix fields. Say you're using a matrix field for your 'article-body'
# that has rich-text fields, headings, photos with captions, and slideshows
# all mixed together as different blocks. The slideshow is created by just placing
# single slideshow images (with captions) next to each other in the matrix.
#
# For example:
@kevinsmith
kevinsmith / sandsync.sh
Created November 18, 2014 22:51
Script to sync staging (sandbox) DB and file uploads with local environment
#!/bin/sh
#
# sandsync.sh
#
# This is a shell script for keeping sandbox and local EE
# environments in sync. It takes a backup of a project's sandbox database,
# clears the local database and imports the remote's backup into local,
# and performs a one-way sync of the uploads directory from remote to local.
# Drop it in the directory above your version-controlled projected directory.
# Does not include 'cp', which isn't present on the CP landing page.
# The SCRIPT_NAME will output 'mysystemdir/index.php' when in the control panel.
# I always set the system folder as a variable at the top of our config, because
# it is used in a few places.
$system_folder = 'mysystemdir';
$config['show_profiler'] = (strpos($_SERVER['SCRIPT_NAME'], $system_folder) !== false) ? 'n' : 'y';
@croxton
croxton / stash_embed_snippets.md
Last active April 8, 2018 02:24
Stash embeds as snippets

Stash embeds with the process="start" parameter can be used to include pre-parsed or unparsed template tags in your template before any other tags or variables are parsed. This can be a more flexible alternative to EE's built-in snippet functionality.

It makes sense to combine snippets that are used globally into a single file so that they are included with the minimum of overhead. Call it somewhere in your template:

{!-- template at /stash_templates/snip/global.html --}
{stash:embed:snip:global process="start"}

Inside the stash embed:

{!-- unparsed snippets --}